OpenAI
gpt-4
openai/gpt-4
Price per million tokens
- Input
- $37.980
- Output
- $75.960
- Cache write
- not offered
- Cache read
- not offered
What you pay. It is what the tokens cost us to buy plus 20%, and your usage page shows what we paid beside what you paid on every request you send.
Limits
- Context window
- 8,191 tokens
- Max output
- 4,096 tokens
- Images
- text only
What it costs to run
| Workload | Input | Output | Cost | Per 1,000 calls |
|---|---|---|---|---|
| Short chat turn | 1,000 | 500 | $0.0760 | $75.96 |
| Long document summary | 50,000 | 2,000 | $2.0509 | $2050.92 |
| Agent step with tools | 20,000 | 1,500 | $0.8735 | $873.54 |
| 1M in, 1M out | 1,000,000 | 1,000,000 | $113.9400 | $113940.00 |
Calling it
const res = await client.chat.completions.create({ model: "openai/gpt-4", messages: [{ role: "user", content: "Hello" }], });