GPT 5.4 API examples with APIDot: cURL, Node.js, request fields, responses, and production notes.
Try on APIDot | Get API Key | API Docs | Pricing | Main Examples
OpenAI GPT 5.4 API for efficient professional task execution, spreadsheet and document analysis, tool-oriented planning, code/test handoffs, streaming, and OpenAI-compatible chat completions.
This repository turns that APIDot workflow into runnable server-side examples: a cURL request, a native Node.js example, request fields, response handling notes, and production integration guardrails.
GPT 5.4 is OpenAI's frontier model for efficient professional work, combining broad reasoning with coding and agentic strengths from the GPT-5.3-Codex line. It is designed for work that should produce an action plan, review, handoff, or structured operational answer rather than casual chat.
Choose GPT 5.4 for spreadsheet and document reasoning, legal or financial material review, coding plans, browser-operation plans, tool selection, and professional workflows that need reliable judgment without always escalating to GPT 5.5. It is the middle ground between cheaper bulk models and the most expensive long-horizon option.
On APIDot, call gpt-5.4 through OpenAI-compatible text chat. The page centers on POST /v1/chat/completions with Bearer authentication, also documents the configured Responses-compatible path, and keeps hosted Computer Use, web search, visual input UI, and file upload outside the current APIDot page contract.
POST /v1/chat/completions
Send OpenAI-compatible chat completions requests to GPT 5.4 for professional task execution, spreadsheet and document analysis, tool planning, and coding handoffs.
- Use
gpt-5.4for professional tasks such as spreadsheet review, legal or finance material analysis, tool-selection plans, browser-operation handoffs, and implementation planning. - Give the model the business objective, evidence, tool constraints, expected output format, and verification criteria instead of asking for a generic answer.
- Use
/v1/chat/completionsfor OpenAI-compatible chat clients and APIDot playground parity; use/v1/responsesonly when your client already models work as Responses-style execution. - Read assistant text from
choices[0].message.content, or fromdata.choices[0].message.contentif your response payload is wrapped. - Use
usage.prompt_tokensandusage.completion_tokensto route GPT 5.4 as a professional-work model between cheaper bulk models and GPT 5.5. - Set
stream: trueonly when your client is prepared to consume streaming chat completion events.
cp .env.example .env
# Edit .env and set APIDOT_API_KEY
cd node
npm startUse curl/generate.md when you want a copy-paste cURL request instead of Node.js.
Submit to APIDot:
curl --fail-with-body --request POST \
--url https://api.apidot.ai/v1/chat/completions \
--header "Authorization: Bearer $APIDOT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gpt-5.4",
"messages": [
{
"role": "system",
"content": "You are a professional workflow assistant."
},
{
"role": "user",
"content": "Review this quarterly spreadsheet narrative. Identify formula assumptions to verify, finance risks, and the next checks an analyst should run."
}
],
"max_tokens": 1024
}'Primary payload:
{
"model": "gpt-5.4",
"messages": [
{
"role": "system",
"content": "You are a professional workflow assistant."
},
{
"role": "user",
"content": "Review this quarterly spreadsheet narrative. Identify formula assumptions to verify, finance risks, and the next checks an analyst should run."
}
],
"max_tokens": 1024
}{
"model": "gpt-5.4",
"messages": [
{
"role": "system",
"content": "You are a professional workflow assistant."
},
{
"role": "user",
"content": "Review this quarterly spreadsheet narrative. Identify formula assumptions to verify, finance risks, and the next checks an analyst should run."
}
],
"max_tokens": 1024
}| Field | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Target model ID. Use gpt-5.4. |
| messages | object[] | yes | Conversation array in OpenAI-compatible chat format. Include the objective, evidence, tool constraints, and desired professional output. |
| messages[].role | string | yes | Message role. Use system, user, or assistant. |
| messages[].content | string | yes | Text content for the message. |
| temperature | number | no | Sampling temperature, usually between 0 and 2. |
| top_p | number | no | Nucleus sampling value, usually between 0 and 1. |
| max_tokens | integer | no | Maximum output tokens to return. Increase it for spreadsheet audits, professional memos, or implementation plans. |
| stream | boolean | no | Set true to receive streaming chat completion events. |
| Field | Type | Description |
|---|---|---|
| id | string | Chat completion response ID. |
| choices[].message.content | string | Generated assistant text. |
| choices[].finish_reason | string | Reason generation stopped. |
| usage.prompt_tokens | integer | Input token count billed at the GPT 5.4 input rate. |
| usage.completion_tokens | integer | Output token count billed at the GPT 5.4 output rate. |
| usage.total_tokens | integer | Total token count across input and output. |
{
"id": "chatcmpl_1234567890",
"object": "chat.completion",
"model": "gpt-5.4",
"choices": [{"index": 0, "message": {"role": "assistant", "content": "Start by checking the model assumptions, then verify the variance drivers..."}, "finish_reason": "stop"}],
"usage": {"prompt_tokens": 126, "completion_tokens": 228, "total_tokens": 354}
}| Code | Name | Description |
|---|---|---|
| 401 | Unauthorized | Missing, invalid, or disabled APIDot API key. |
| 400 | Invalid request | The request body is missing required fields, or the requested API path is not supported for this model. |
| 402 | Insufficient credits | The account does not have enough credits for the requested token usage. |
| 500 | Service error | The GPT 5.4 request failed or timed out. |
- Keep APIDot API keys in server-side environment variables.
- Persist selected model, request payload, user ID, and response metadata together for support and cost review.
- Avoid logging API keys, private prompts, customer data, private media URLs, or internal callback URLs.
- Validate request fields before sending traffic to APIDot.
- Retry transient network failures with backoff, but do not retry unchanged invalid payloads.
- Committing a real API key or
.envfile. - Calling APIDot directly from browser code instead of a server-side environment.
- Logging private prompts, customer data, API keys, or internal callback URLs.
- Reusing request fields from another model without checking this model's docs.
Send gpt-5.4 in the model field.
Use Authorization: Bearer $APIDOT_API_KEY when calling /v1/chat/completions.
Use /v1/chat/completions for OpenAI-compatible chat clients and APIDot playground parity. Use /v1/responses when your integration already depends on Responses-style workflow state.
No. This APIDot docs page documents text chat completions and the configured Responses path. It does not expose hosted Computer Use, web search, file upload UI, or a platform-level agent environment.
Yes. Set stream: true to receive streaming chat completion events.
Read usage.prompt_tokens, usage.completion_tokens, and usage.total_tokens from the response for cost tracking and model routing.
- Website: https://apidot.ai
- Docs: https://apidot.ai/docs
- GPT 5.4 docs: https://apidot.ai/docs/gpt-5-4
- GPT 5.4 model page: https://apidot.ai/models/gpt-5-4
- GitHub organization: https://github.com/APIDotAI
- Main examples: https://github.com/APIDotAI/apidot-examples