All models

OpenAI

gpt-5-codex

GPT-5-Codex is a version of GPT-5 optimized for agentic coding in Codex. Like its predecessor codex-1, the model is trained on real-world coding tasks using reinforcement learning across diverse environments to produce code that closely matches human style and PR preferences, follow instructions precisely, and iteratively run tests until they pass.

textAPI availablestreaming
gpt-5-codex

Tokely price / 1M tokens

$2.297813input
$0.229782cached input
$18.3825output

USD · Published rate · Updated 2026-10-06

Context window

UnconfirmedNo verified context specification

First request

Available
curl https://tokely.me/v1/responses \
  -H "Authorization: Bearer $TOKELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5-codex",
    "input": "Hello!",
    "max_output_tokens": 1024,
    "store": false
  }'

Set TOKELY_API_KEY to your dashboard key. Requests require a funded Tokely balance. Base URL: https://tokely.me/v1.

Compare nearby prices

USD per million tokens. Compare price and context; these are not quality benchmarks.
ModelInputOutputContext
gpt-5-codexOpenAI · this model$2.297813$18.3825Unconfirmed
gpt-5OpenAI$2.297813$18.3825400,000
gpt-5-2025-08-07OpenAI$2.297813$18.3825400,000
gpt-5-chat-latestOpenAI$2.297813$18.3825Unconfirmed
gpt-5.1OpenAI$2.297813$18.3825400,000

Capabilities & limits

Provider
OpenAI
API model ID
gpt-5-codex
Category
Text
Endpoints
POST /v1/responses
Tokely max output
4,096 tokens / request, including reasoning tokens
Default output
256 tokens. Set an explicit limit for longer responses.
Request limits
256 KB JSON body · 128 messages · 32 function tools
Rate limit
60 requests / minute / account, across its keys
Supported input
Text messages and function tool results
Model reference

API reference

Authenticate with Authorization: Bearer YOUR_TOKELY_API_KEY. Use an OpenAI SDK with the Tokely base URL.

model
Required string: gpt-5-codex
input
Text or an array of text messages and function call results. Send history in each request; use store=false.
max_output_tokens
Optional integer, 1–4,096. Defaults to 256.
stream
Set true for Server-Sent Events (SSE).

The response contains output items and usage (input_tokens, output_tokens, total_tokens). Streaming uses named Responses events.

400 / 415
Invalid request, parameter, endpoint for this model, or content type.
401 / 403
Invalid, revoked or restricted API key.
402
Insufficient account balance or API key budget.
429
Request limit reached. Retry after the indicated delay.
502 / 503 / 504
Upstream failure, temporary service unavailability or request timeout.

Frequently asked questions

How much does gpt-5-codex cost?

$2.297813 per million input tokens, $18.3825 per million output tokens and $0.229782 per million cached input tokens. Usage is charged to your Tokely balance.

Do I need a separate OpenAI account?

Use your Tokely API key and balance. A separate provider key is not required.

How do I switch to this model?

Set model to gpt-5-codex and use /v1/responses. Keep your Tokely base URL and API key.

Related versions