GPT-5.4

gpt-5.4

GPT-5.4 is a proven production workhorse for chat and tool-calling.

Overview

Official $2.50 / $15.00
LumeAPI $1.25 / $7.50
POST /v1/chat/completions
Base: https://api.lumeapi.site/v1

Auth: Authorization: Bearer sk-… from the Console. Use this model id exactly in the model field.

Request parameters — Chat completions

Only parameters relevant to gpt-5.4 are listed below.

FieldTypeReqDescription
modelstringOne of 30 whitelisted model ids (see model tables)
messagesarrayOpenAI-style messages[] — role + content
streambooleanSSE streaming
temperaturenumberSampling temperature (model-dependent default if omitted)
max_tokensintegerMax completion tokens

Examples

bash
curl https://api.lumeapi.site/v1/chat/completions \
  -H "Authorization: Bearer $LUMEAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "messages": [{"role":"user","content":"Hello"}]
  }'

Streaming (optional)

Enable streaming

POST /v1/chat/completions with "stream": true. Response Content-Type is text/event-stream.

SSE frame format

First line: retry: 3000 (reconnect delay ms). Each chunk: id: N then data: {JSON}. Heartbeats: : PING comment lines (~every 30s). End: data: [DONE].

Save stream_id

Use the "id" field inside the first data JSON (e.g. chatcmpl-abc…) as stream_id for resume.

Resume after disconnect

GET /v1/chat/completions/stream/resume/{stream_id}?last_event_id=N with the same Bearer key. Also accepts Last-Event-ID header. Replays cached chunks from N+1; waits for new chunks if still generating.

404 stream gone

Hub expired (>30 min after completion) or server restarted. Do not retry resume — re-submit POST or fetch final result another way.

Video jobs

Video models use async POST/GET polling, not SSE. See Video Integration section.

Errors

  • 401 — invalid or missing Bearer key
  • 402 — insufficient wallet balance (top up in Account)
  • 403 — model id not on the whitelist / wrong id spelling
  • 429 — rate limited; back off and retry
  • 502 — temporary gateway error; retry