Skip to main content

Completions Response Format

Here’s the response schema as a TypeScript type:
TypeScript
Here’s an example response:
When using models that support reasoning (like OpenAI o1, o3 series), the reasoning_tokens field in completion_tokens_details shows how many tokens were used for the model’s internal reasoning process. These tokens are part of the completion_tokens count and contribute to the overall cost.

Finish Reason

Some models and providers may have additional finish reasons. The raw finish_reason string returned by the model is available via the native_finish_reason property.