Create a chat completion

Generates a model response for a conversation. Supports streaming (`stream: true`, server-sent events) and non-streaming responses. When streaming, each frame is a `data:` line holding one JSON completion chunk, the chunk carrying `usage` has an empty `choices` array, and the stream ends with the literal `data: [DONE]`. OpenAI-compatible: the supported fields are documented here, and the wider OpenAI SDK parameter set is accepted so that existing OpenAI code runs unmodified.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

x-session-idstringOptional

Groups related requests into one session. Required when using planner_mode, which uses it to resume a paused plan.

Request

This endpoint expects an object.
modelstringRequired

The ASI:One model to use.

messageslist of objectsRequired
The conversation so far.
streambooleanOptionalDefaults to false

If true, partial deltas are streamed as server-sent events.

temperaturedoubleOptional0-2
Sampling temperature.
max_tokensintegerOptional
Maximum number of tokens to generate.
top_pdoubleOptional0-1
Nucleus sampling probability mass.
stoplist of stringsOptional
Up to four strings that end generation when produced.
toolslist of objectsOptional
A list of tools the model may call. See the Tool Calling guide.
tool_choiceenum or map from strings to anyOptional

Controls which (if any) tool is called.

parallel_tool_callsbooleanOptional
Whether the model may call several tools in one turn.
response_formatobjectOptional
Constrains the reply's format. See the Structured Data guide.
enable_thinkingbooleanOptional

ASI:One extension. Whether the model reasons before answering. See the Reasoning guide.

thinking_budgetintegerOptional0-16384

ASI:One extension. Maximum tokens the model may spend reasoning. Applies on asi1.

planner_modebooleanOptional

ASI:One extension. Routes the request to the planner, which breaks it into steps and runs them against tools and Agentverse agents. Available on asi1, asi1-ultra and asi1-mini. See the Planner Mode guide.

agentslist of stringsOptional

ASI:One extension. Agentverse agent addresses the planner may use without discovering them first. Used with planner_mode.

Response

A chat completion object, or an SSE stream of completion chunks when stream is true.

idstring
objectstring
choiceslist of objects
A list of generated choices.
createdinteger

Unix timestamp (seconds) of creation.

modelstring
The model that produced the response.
usageobject
Token usage for the request.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error