Key Capabilities
- OpenAI-compatible — Drop-in replacement for the OpenAI SDK, no other code changes needed
- Streaming — Real-time token streaming via SSE
- Tool calling — Supports function calling and tool use
- Flexible output — Supports JSON mode and structured outputs
Quick Example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed value: gpt-5.1 |
messages | array | Yes | Array of { role, content } objects |
max_tokens | integer | No | Maximum number of tokens to generate |
temperature | float | No | 0–2, 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 where generation stops |
tools | array | No | List of tools the model can call |
response_format | object | No | Specify output format (e.g., JSON mode) |
API Reference
View the interactive API Playground for GPT-5.1.

