Key capabilities
- OpenAI-compatible — Works as a drop-in replacement with the OpenAI SDK
- Streaming — Supports real-time token streaming via SSE
- Tool use — Supports function calling and tool use
- Flexible output — Supports JSON mode and structured output
Quick example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be gpt-5.1-chat-latest |
messages | array | Yes | List of { role, content } objects |
max_tokens | integer | No | Maximum tokens to generate |
temperature | float | No | 0\u20132. Controls randomness. Default: 1 |
stream | boolean | No | Enable SSE streaming. Default: false |
top_p | float | No | Nucleus sampling threshold. Default: 1 |
stop | string / array | No | Sequences that stop generation |
tools | array | No | List of tools the model may call |
response_format | object | No | Specify output format (e.g. JSON mode) |
API Reference
View the interactive API playground for GPT-5.1 Chat Latest.