> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytespike.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-5.4

> 5.4 standard tier — the workhorse 5-series for general production work, balancing latency and quality.

**Vendor:** OpenAI
**Model ID:** `gpt-5-4`
**Capability:** 128K context · tool use · vision · streaming · structured output
**Pricing:** per-token, standard tier ([live rate](https://bytespike.ai/pricing#text))

GPT-5.4 is the workhorse of the 5.4 wave — better tool-call argument
generation than 5.2, tighter structured output, same 128K context.
Production default for any team that needs more than mini quality but
doesn't want the 5.5 latency premium. For multi-step reasoning, see
[GPT-5.5](/api-reference/text/gpt-5-5).

## Request

```bash theme={null}
curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5-4",
    "messages": [{"role": "user", "content": "Refactor this React component to use hooks."}]
  }'
```

### Body parameters

| Field             | Type    | Required | Default   | Notes                      |
| ----------------- | ------- | -------- | --------- | -------------------------- |
| `model`           | string  | yes      | —         | `gpt-5-4`                  |
| `messages`        | array   | yes      | —         | —                          |
| `max_tokens`      | integer | no       | model max | Max: 16384.                |
| `temperature`     | number  | no       | 1.0       | —                          |
| `tools`           | array   | no       | —         | Parallel function calling. |
| `response_format` | object  | no       | —         | JSON / structured output.  |
| `stream`          | boolean | no       | false     | SSE streaming.             |

## Response

```json theme={null}
{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "gpt-5-4",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 412, "completion_tokens": 587, "total_tokens": 999}
}
```

## Code examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://llm.bytespike.ai/v1/chat/completions \
    -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
    -H "content-type: application/json" \
    -d '{"model": "gpt-5-4", "messages": [{"role": "user", "content": "Refactor this React component."}]}'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(base_url="https://llm.bytespike.ai/v1", api_key="$BYTESPIKE_API_KEY")
  resp = client.chat.completions.create(
      model="gpt-5-4",
      messages=[{"role": "user", "content": "Refactor this React component to use hooks."}],
  )
  print(resp.choices[0].message.content)
  ```

  ```javascript Node theme={null}
  import OpenAI from "openai"

  const client = new OpenAI({
    baseURL: "https://llm.bytespike.ai/v1",
    apiKey: process.env.BYTESPIKE_API_KEY,
  })
  const resp = await client.chat.completions.create({
    model: "gpt-5-4",
    messages: [{ role: "user", content: "Refactor this React component to use hooks." }],
  })
  console.log(resp.choices[0].message.content)
  ```
</CodeGroup>

## Streaming + caching

`"stream": true` for SSE. Automatic prompt caching for repeated
prefixes — biggest cost win on long system prompts.

## Errors

| Code                        | Trigger  | Billed?         |
| --------------------------- | -------- | --------------- |
| 400 / 401 / 402 / 422 / 429 | Standard | No              |
| 5xx                         | Upstream | No (auto-retry) |

## When to use

* Default production model for code generation, content rewriting, and tool-using agents.
* For the latest flagship / multi-step reasoning, see [GPT-5.5](/api-reference/text/gpt-5-5).
* For lower cost, see [GPT-5.4-mini](/api-reference/text/gpt-5-4-mini).

## Limits

| Limit                   | Value          |
| ----------------------- | -------------- |
| Context window          | 128K tokens    |
| Max output              | 16384 tokens   |
| Supports tool use       | Yes (parallel) |
| Supports vision         | Yes            |
| Supports streaming      | Yes            |
| Supports prompt caching | Automatic      |
