GPT-5.1 - Complete API Reference
- Use OpenAI SDK format to call GPT-5.1 series models
- Synchronous processing mode, real-time response
- Available models: gpt-5.1 (base), gpt-5.1-chat (optimized for conversation), gpt-5.1-thinking (with reasoning output)
- Text conversation: Single or multi-turn contextual dialogue
- System prompts: Customize AI role and behavior
- Multimodal input: Supports text + image mixed input
- Tool calling: Supports Function Calling
- Reasoning output: gpt-5.1-thinking returns reasoning_content field showing thought process
https://direct.evolink.ai, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.Authorizations
All APIs require Bearer Token authentication
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEYBody
Model name for chat completion
- gpt-5.1: Base model for general tasks
- gpt-5.1-chat: Optimized for conversational tasks
- gpt-5.1-thinking: Features reasoning capabilities with thinking process output (returns reasoning_content)
gpt-5.1, gpt-5.1-chat, gpt-5.1-thinking "gpt-5.1"
List of messages for the conversation, supports multi-turn dialogue and multimodal input
1Whether to stream the response
true: Stream response, returns content chunk by chunk in real-timefalse: Wait for complete response and return all at once
false
Maximum number of tokens to generate in the response
x >= 12000
Sampling temperature, controls randomness of output
- Lower values (e.g., 0.2): More deterministic and focused output
- Higher values (e.g., 1.5): More random and creative output
0 <= x <= 21
Nucleus sampling parameter
- Controls sampling from tokens with cumulative probability
- For example, 0.9 means sampling from tokens with top 90% cumulative probability
0 <= x <= 10.9
Frequency penalty, number between -2.0 and 2.0
- Positive values penalize new tokens based on their frequency in the text
-2 <= x <= 20
Presence penalty, number between -2.0 and 2.0
- Positive values penalize new tokens based on whether they appear in the text
-2 <= x <= 20
Stop sequences, generation stops when these sequences are matched
List of tools for Function Calling
Response
Chat completion successful
Unique identifier for the chat completion
"chatcmpl-abc123"
The model used for completion
"gpt-5.1"
Response type
chat.completion "chat.completion"
Unix timestamp when the completion was created
1698999496
List of completion choices
Token usage statistics