GPT-5.4 Chat

GPT-5, fourth generation — stronger general reasoning and multimodal capabilities

POST/v1/chat/completions
  • Compatible with the OpenAI Chat Completions API format
  • Select the gpt-5.4 model via the model parameter
  • Supports streaming output (SSE)
  • Supports multi-turn conversations, system prompts, and vision input

Authorizations

AuthorizationstringRequired

All endpoints require Bearer Token authentication.

Get an API Key: visit the API Key management page to obtain your API Key.

Add it to the request header:

Authorization: Bearer YOUR_API_KEY

Body

modelstringRequiredDefault gpt-5.4

Model name

Example: "gpt-5.4"

messagesobject[]Required

List of conversation messages, in chronological order

ShowHide messages[n]
rolestringRequired

Message role, one of system, user, assistant

contentstringRequired

Message content, a string or an array of content blocks (images supported)

streambooleanDefault false

Whether to enable streaming output (Server-Sent Events)

  • true: stream results token by token
  • false: wait for the full response and return it all at once
max_tokensinteger

Maximum number of tokens to generate

When unset, the model's default limit is used

temperaturenumberDefault 1

Sampling temperature, controls output randomness

  • Range: 0 ~ 2
  • Lower values produce more stable output, higher values more random output
top_pnumberDefault 1

Nucleus sampling probability threshold

Range: 0 ~ 1. We recommend not modifying both temperature and top_p at the same time

stopstring | string[]

Stop sequences; generation stops when the specified string is encountered

Up to 4 stop sequences

Response

idstring

Unique identifier for this request

objectstring

Object type, always chat.completion

createdinteger

Request creation time (Unix timestamp)

modelstring

The model actually used

choicesobject[]

List of generated results

  • choices[].message.role: message role, always assistant
  • choices[].message.content: the generated text content
  • choices[].finish_reason: reason for stopping — stop / length / content_filter
  • choices[].index: result index
usageobject

Token usage statistics for this request

  • usage.prompt_tokens: number of input tokens
  • usage.completion_tokens: number of output tokens
  • usage.total_tokens: total number of tokens