Back to Comparison Hub/GPT Codex Pricing
Text to Text

GPT Codex API Pricing

OpenAI GPT Codex delivers advanced coding capabilities with scalable reasoning depth. Supports multiple model variants (gpt-5-codex through gpt-5.4-codex) and multimodal inputs. Token-based pricing: $1.25/M input tokens, $9.00/M output tokens. Two endpoints: standard async (/gpt-codex) and live streaming (/gpt-codex/stream) via SSE.

Savings Alert29% ↓Cheaper than OpenAI (official)

About GPT Codex

GPT Codex is OpenAI's code-specialized model series built on GPT-5 architecture. Optimized for code generation, debugging, and complex engineering workflows with scalable reasoning depth. Supports five model variants from gpt-5-codex to gpt-5.4-codex, multimodal inputs, and SSE streaming. Token-based pricing: $1.25 per million input tokens and $9.00 per million output tokens.

Interactive Savings Calculator

Estimate monthly API spend and compare absolute developer savings.

Monthly API Generations10,000 runs
50025,00050,00075,000100,000+
MuAPI Monthly Cost

$12500.00

$1.25/M input tokens, $9.00/M output tokens
OpenAI (official) Cost

$17500.00

~$1.75/M input tokens, ~$14.00/M output tokens
Estimated Monthly Savings$5000.00
Annual Savings$60000.00

Detailed Pricing Breakdown

ProviderEstimated RateNotes
muapiapp$1.25/M input tokens, $9.00/M output tokensToken-based billing. Minimum $0.00023 per call. All 5 Codex variants share the same pricing. Supports Prompt Caching (0.1x for hits, 1.25x for creation).
OpenAI (official)~$1.75/M input tokens, ~$14.00/M output tokensOfficial pricing via api.openai.com.
Fal.aiNot availableGPT Codex is not available on Fal.ai.

Developer Integration Snippets

1import requests 2import time 3import json 4 5api_key = "YOUR_API_KEY" 6url = "https://api.muapi.ai/workflow/run/gpt-codex" 7 8def poll_for_result(run_id): 9 url = f"https://api.muapi.ai/workflow/run/{run_id}/api-outputs" 10 headers = { 11 "Content-Type": "application/json", 12 "x-api-key": f"{api_key}", 13 } 14 while True: 15 response = requests.get(url, headers=headers) 16 result = response.json() 17 18 if result['status'] == 'completed': 19 return json.loads(result['outputs']) 20 21 if result['status'] == 'failed': 22 raise Exception(result.get('error', 'Generation failed')) 23 24 time.sleep(5) 25 26data = { 27 "schemas": { 28 "input_data": { 29 "x-order-properties": [ 30 "prompt", 31 "model", 32 "image_url" 33 ], 34 "type": "object", 35 "properties": { 36 "prompt": { 37 "type": "string", 38 "title": "Prompt", 39 "name": "prompt", 40 "description": "The coding task or instruction.", 41 "examples": [ 42 "Implement a binary search tree with insert, delete, and search methods in Python." 43 ] 44 }, 45 "model": { 46 "type": "string", 47 "title": "Model", 48 "name": "model", 49 "description": "Codex model variant to use.", 50 "enum": [ 51 "gpt-5.4-codex", 52 "gpt-5.3-codex", 53 "gpt-5.2-codex", 54 "gpt-5.1-codex", 55 "gpt-5-codex" 56 ], 57 "examples": [ 58 "gpt-5.4-codex" 59 ] 60 }, 61 "image_url": { 62 "type": "string", 63 "title": "Image URL", 64 "name": "image_url", 65 "description": "Optional image URL for multimodal requests.", 66 "field": "image", 67 "examples": [] 68 } 69 }, 70 "title": "Text", 71 "required": [ 72 "prompt" 73 ], 74 "endpoint_url": "gpt-codex" 75 }, 76 "output_data": { 77 "type": "object", 78 "properties": { 79 "text": { 80 "type": "string", 81 "title": "Text", 82 "description": "Generated code or text response.", 83 "examples": [ 84 "class BinarySearchTree:..." 85 ] 86 } 87 }, 88 "title": "GptCodexOutput", 89 "required": [ 90 "text" 91 ] 92 } 93 } 94} 95 96headers = { 97 "Content-Type": "application/json", 98 "x-api-key": f"{api_key}", 99} 100 101response = requests.post(url, json=data, headers=headers) 102 103result = response.json() 104print("Queued:", result) 105 106outputs = poll_for_result(result["run_id"]) 107print("Completed:", outputs) 108

Model FAQ

Ready to scale your production?

Get instant access to developer keys. Integrate high-speed dynamic models in minutes with our robust SDKs.