/api/ai/BuiltInModel/chat
Total calls: 5
AI Chat (unified entry)
Start a chat with the model of your choice: supports a single message, a full message list, a caller-supplied system prompt, image understanding and streaming output.
Optional: omit to use the platform default model. Candidates come from the platform (see the Model List endpoint).
Optional: message content for a simple single-turn chat (provide at least one of content or messages)
Optional: for multi-turn chat, formatted as a JSON array with role set to user/assistant; takes precedence over content
Optional: temporarily override the platform setting; omit to use the prompt configured for the model; empty string to use no system prompt
Optional: only for models marked as vision-capable. Public image URLs as a JSON array or plain text (newline/comma separated); the per-model image cap is configured on the platform (adjustable in the console).
Optional: pass your own key (it must belong to the vendor of the chosen model); otherwise the platform key is used.
Optional: when true, the response is SSE (text/event-stream), pushed chunk by chunk
- The request body is an application/x-www-form-urlencoded form; this service requires the project signature.
- Provide at least one of content or messages, otherwise a missing parameter error is returned.
- The images parameter works only for vision-capable models; other models return an invalid-value error (20003). The number of images is capped per model on the platform (adjustable in the console); exceeding the cap returns the same invalid-value error.
- Temperature, max reply length and stop words are configured per model by the platform and are not accepted from callers; passing one returns an invalid-value error (20003).
- Streaming mode returns SSE: each frame is either data: {"content": "chunk"} (the answer) or data: {"reasoning": "chunk"} (a reasoning model's thinking; only such models emit it, and it is sent separately from the answer, so ignore it if you only care about the answer), terminated by data: [DONE]. The live debugger renders the answer as Markdown and prints it character by character; a reasoning model's thinking goes into a collapsible "Reasoning" block that is expanded while it streams and collapses once the answer starts.
- Live debugging really consumes upstream quota — make sure the platform key works first.
- The former prefix-completion capability (prefix / prefix_content) has been retired; passing it returns an invalid-value error.