- Compatible with the OpenAI Chat Completions API format
- Specify the
gpt-5.4model through themodelparameter - Supports streaming output (SSE)
- Supports multi-turn conversations, system prompts, and visual input
Authorizations
All endpoints require authentication using a Bearer Token
Get an API Key: Visit the API Key Management Page to obtain your API Key
Add the following to the request headers:
Authorization: Bearer YOUR_API_KEYBody
gpt-5.4Model name
Example: "gpt-5.4"
List of conversation messages arranged in chronological order
falseWhether to enable streaming output (Server-Sent Events)
true: Stream the response token by tokenfalse: Wait for the complete response and return it all at once
Maximum number of tokens to generate
If not specified, the model's default limit is used
1Sampling temperature that controls output randomness
- Range:
0~2 - Lower values produce more consistent output, while higher values produce more random output
1Probability threshold for nucleus sampling
Range: 0 ~ 1. It is recommended not to modify both temperature and top_p at the same time
Stop sequences. Generation stops when any specified string is encountered
Up to 4 stop sequences are supported
Response
Unique identifier for this request
Object type, always chat.completion
Request creation time (Unix timestamp)
Name of the model actually used
List of generated results
choices[].message.role: Message role, alwaysassistantchoices[].message.content: Generated text contentchoices[].finish_reason: Completion reason:stop/length/content_filterchoices[].index: Result index
Token usage statistics for this request
usage.prompt_tokens: Number of input tokensusage.completion_tokens: Number of output tokensusage.total_tokens: Total number of tokens
Response Examples
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1703884800, "model": "gpt-5.4", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! I'm GPT-5.4, the latest version of OpenAI's fifth-generation flagship model. I offer enhanced capabilities in reasoning, code generation, multimodal understanding, and more. How can I help you?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 15, "completion_tokens": 45, "total_tokens": 60 }}{ "error": { "code": "invalid_request_error", "message": "The 'messages' field is required.", "param": "messages", "type": "invalid_request_error" }}{ "error": { "code": "unauthorized", "message": "Invalid API key", "type": "authentication_error" }}