Inference
Call Sikaru catalog models with OpenAI-compatible chat completions, completions and Responses requests, look up what each model supports, and handle field-level errors.
Sikaru serves its model catalog through OpenAI-compatible endpoints. Existing OpenAI SDK code works by changing the base URL, API key and model. Every request either behaves as the OpenAI contract describes or fails with an error that names the field. Sikaru never silently ignores a request field.
Authenticate with a Sikaru API key that has the inference:invoke scope, sent as Authorization: Bearer <key>. The CLI can instead use your sikaru login sign-in: it sends the sign-in with the saved project in the Sikaru-Project header, and usage is billed to that project.
Call a model
Python
TypeScript
OpenAI SDK
Sikaru is the generated client with OpenAI-shaped create(stream=...) on its inference resources. Construct it exactly like SikaruApi; every other resource is unchanged.
AsyncSikaru mirrors it: await client.chat.completions.create(..., stream=True) returns an async iterator.
Streamed chat and completions requests always end with a usage chunk, so token counts are available without setting stream_options.
How each request field is handled
Every documented OpenAI request parameter on the three endpoints is accepted and falls into exactly one class:
A field outside the OpenAI surface and the documented extensions returns 400 with code unknown_parameter. Sikaru chooses where each request is served, so the routing fields provider, transforms, models and route, and usage: {"include": true}, are accepted for client compatibility and have no effect.
Requests are stateless for API keys: send history inline. store: true, and previous_response_id on Responses, return 400 with code unsupported_continuation.
Extensions
These open-weight controls are first-class top-level fields. Each is forwarded on models that declare it and rejected with a named 400 otherwise.
Send only one of reasoning_effort, thinking and reasoning per request.
Look up a model
Model IDs take the lab/model form, such as z-ai/glm-5.3-flash. GET /v1/models/{model}, and each entry of GET /v1/models, describes one model:
pricing: US dollars per million input, output and cached input tokens.specs.modalities: what the model reads and writes.specs.endpoints: the request endpoints the model serves.specs.reasoning: the reasoning controls and what each standard effort runs at, ornullwhen the model has none.specs.supported_parameters: every request parameter the model accepts.structured_outputsmeans JSON-schemaresponse_format.specs.sampling_defaults: the model lab’s recommended sampling. A request that omitstemperature,top_p,top_kormin_pruns at the value shown here; any value you send wins.nullmeans the serving default applies.
Reasoning effort normalization
Effort written in the standard vocabulary (none, minimal, low, medium, high, xhigh, max) runs at the nearest level the model declares. Ties resolve to the lower level. true selects the model’s default effort, and false turns reasoning off where the model declares none. The specs.reasoning.normalization table shows exactly what each value runs at; a null entry means that value is rejected for the model. Only values outside the vocabulary are always rejected.
Reasoning continuity
On chat, models that declare reasoning history accept prior reasoning_content in assistant messages, with reasoning_history choosing how it is used.
Errors
Errors use the OpenAI envelope:
A request rejected by Sikaru’s validation never reaches a model and is not charged.
