Chat

Create a chat completion

Send a conversation and receive the next assistant message. Set stream: true for Server-Sent Events. Models that reason return their reasoning in reasoning_content alongside content; when replaying a tool-calling conversation, send reasoning_content back on the assistant messages.

post/chat/completions

Request

  • Base URL
    https://api.openscale.so/v1
  • URL
    https://api.openscale.so/v1/chat/completions
  • Auth
    HTTP bearer

Request body

model'deepseek/deepseek-v4.1-flash' | 'z-ai/glm-5.3-flash' | 'deepseek/deepseek-v4.1-flash-1017' | 'deepseek/deepseek-v4.1-flash-0910' | 'z-ai/glm-5.3-flash-0828' | 'deepseek/deepseek-v4.1-flash:fast' | 'deepseek/deepseek-v4.1-flash-1017:fast' | 'deepseek/deepseek-v4.1-flash-0910:fast' required

A chat model id from GET /models.

streamboolean

Stream the completion as Server-Sent Events. The final chunk before [DONE] carries usage.

max_tokensinteger

Maximum completion tokens, including reasoning tokens. Reasoning models spend part of this budget thinking, so allow room for it. Above the model's output limit the request is refused with max_tokens_exceeded.

max_completion_tokensinteger

Same as max_tokens (the newer OpenAI name).

temperaturenumber
top_pnumber
reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'

How much the model reasons before answering (OpenAI style); none turns reasoning off.

logprobsboolean
top_logprobsinteger
frequency_penaltynumber
presence_penaltynumber
userstring
service_tierstring

priority runs the request in fast mode (same model, faster serving, higher price) when it is available; any other value runs at the standard tier. The response reports the tier that served it.

Example request

{
  "service_tier": "priority"
}

Response

The completion, or an SSE stream when stream is true.

idstring
object'chat.completion'
createdinteger
model'deepseek/deepseek-v4.1-flash' | 'z-ai/glm-5.3-flash' | 'deepseek/deepseek-v4.1-flash-1017' | 'deepseek/deepseek-v4.1-flash-0910' | 'z-ai/glm-5.3-flash-0828' | 'deepseek/deepseek-v4.1-flash:fast' | 'deepseek/deepseek-v4.1-flash-1017:fast' | 'deepseek/deepseek-v4.1-flash-0910:fast'
service_tier'default' | 'priority'

The tier that served the request: priority in fast mode.

Example response

{
  "id": "chatcmpl-ucOlCLBJhTr5ahpQzgJaeiK8"
}

Changes

No recorded changes to this operation across all 1 revision of this API.