POST/v1/chat/completions
Create a model response for a chat conversation.
Generates the next assistant message for a conversation. Fully compatible with the OpenAI Chat Completions API, so existing SDKs work unchanged.
Request body
Model ID such as anthropic/claude-3.5-sonnet.
The conversation so far.
system, user, assistant or tool.
Text, or an array of text and image_url parts for vision models.
Required when role is tool.
Stream tokens as server-sent events. See Streaming.
0–2. Higher values give more random output.
Maximum tokens to generate in the reply.
See Parameters & Schema for every supported field.
Response
Unique identifier for the completion.
The 000 Labs model ID that served the request.
Generated messages.
The assistant message with role and content (and tool_calls when tools are used).
stop, length, tool_calls or content_filter.
Token counts used for billing: prompt_tokens, completion_tokens, total_tokens.