# GPT-4o API — pricing & specs

GPT-4o, made by OpenAI, accepts text and image input and returns text. On KeepRouter, GPT-4o costs $2.50 per 1M input tokens and $10.00 per 1M output tokens, billed pay-as-you-go with no monthly fee; actual request cost depends on measured usage. Call it through a compatible KeepRouter endpoint supported by its active route, with the model id `gpt-4o`.

| Spec | Value |
|---|---|
| Maker | OpenAI |
| Modality | Text, vision |
| Context window | 128,000 tokens |
| Input price | $2.50 per 1M tokens |
| Output price | $10.00 per 1M tokens |
| Cached input | $1.25 per 1M tokens |
| Capabilities | Vision (image input), Chat completions, Streaming where supported, Tool calling where supported |
| Endpoint | POST /v1/chat/completions or POST /v1/messages (compatible chat routes) |
| Model id | `gpt-4o` |

## Call it via the compatible chat endpoint

Use POST /v1/chat/completions or, on compatible chat routes, POST /v1/messages; streaming and tool support depend on the model's active route.

### cURL

```bash
curl https://keeprouter.com/v1/chat/completions \
  -H "Authorization: Bearer $KEEPROUTER_KEY" -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'
```

### Python

```python
from openai import OpenAI
client = OpenAI(base_url="https://keeprouter.com/v1", api_key="$KEEPROUTER_KEY")
r = client.chat.completions.create(model="gpt-4o", messages=[{"role":"user","content":"Hello"}])
```

### JavaScript

```js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://keeprouter.com/v1", apiKey: process.env.KEEPROUTER_KEY });
const r = await client.chat.completions.create({ model: "gpt-4o", messages: [{ role: "user", content: "Hello" }] });
```

## Source and verification boundary

[Official OpenAI website](https://openai.com/). KeepRouter's live catalog is authoritative for the customer price and enabled endpoint shown here; the maker remains authoritative for upstream model capabilities and limits.

## Guides

- [Call GPT-4o with the OpenAI SDK](https://keeprouter.com/use-cases/openai-sdk.md)
- [Use GPT-4o in Claude Code](https://keeprouter.com/use-cases/claude-code.md)

## Related models

- [GPT-5.5](https://keeprouter.com/models/gpt-5.5.md) by OpenAI — $5.00 per 1M input tokens and $30.00 per 1M output tokens
- [GPT-OSS 120B](https://keeprouter.com/models/gpt-oss-120b.md) by OpenAI — $0.1500 per 1M input tokens and $0.6000 per 1M output tokens
- [GLM-5V Turbo](https://keeprouter.com/models/glm-5v-turbo.md) by Zhipu AI — $1.20 per 1M input tokens and $4.00 per 1M output tokens
- [GLM-5.2](https://keeprouter.com/models/glm-5.2.md) by Zhipu AI — $1.40 per 1M input tokens and $4.40 per 1M output tokens
- [Grok 4.3](https://keeprouter.com/models/grok-4.3.md) by xAI — $1.25 per 1M input tokens and $2.50 per 1M output tokens
- [GLM-5.1](https://keeprouter.com/models/glm-5.1.md) by Zhipu AI — $1.40 per 1M input tokens and $4.40 per 1M output tokens

## More

- [All models & pricing](https://keeprouter.com/models.md)
- [Quickstart](https://keeprouter.com/docs/quickstart.md)
- [Get an API key](https://keeprouter.com/login?returnTo=%2Fconsole%2Fkeys%3Fmodel%3Dgpt-4o)

_Catalog facts and prices last changed 2026-08-01._
