Response Envelope
Every non-streaming response from the chat completions endpoint shares the following top-level fields.A unique identifier for this completion request, prefixed with
chatcmpl-. Use this ID when reporting issues to Swytcho support.The exact model ID used to generate the response, including any date-pinned version suffix (e.g.,
"swytcho-1-2025-04-01"). This may differ from the alias you requested if the alias was resolved to a pinned version.An array of completion candidates. Most requests return a single choice (
choices[0]). See The choices Array below for the full structure of each element.Token consumption statistics for the request. See The
usage Object below.The choices Array
Each element of choices represents one candidate completion.
The generated message. Contains a
role field (always "assistant") and a content field with the text of the completion. When tool calls are present, content may be null and a tool_calls array is populated instead.The reason the model stopped generating tokens. See Finish Reasons for all possible values and their meanings.
The usage Object
Number of tokens in the input prompt, including the system message and all prior conversation turns.
Sum of
prompt_tokens and completion_tokens. This is the value used to calculate the cost of the request.Full Example Response
Finish Reasons
Thefinish_reason field tells you why the model stopped producing tokens. Always check this value before using the response content in downstream logic.
Streaming responses use a different format: the API sends a series of
text/event-stream chunks, each containing a partial delta object rather than a complete message. The final chunk includes the finish_reason. See the Streaming guide for a full walkthrough of consuming and reassembling streamed output.