OpenAI GPT Codex 提供先进的编程能力和可扩展的推理深度。支持多个模型变体(从 gpt-5-codex 到 gpt-5.4-codex)及多模态entrada。按 token 计费:entrada token 每百万 $1.25,salida token 每百万 $9.00。通过 SSE 提供两个端点:标准异步(/gpt-codex)和实时流式(/gpt-codex/stream)。
About this model
GPT Codex 是 OpenAI 基于 GPT-5 架构打造的代码专用模型系列,针对代码生成、调试和复杂工程工作流进行了优化,并支持可扩展的推理深度。它支持从 gpt-5-codex 到 gpt-5.4-codex 的五种模型变体、多模态entrada和 SSE 流式传输。按 token 计费:entrada token 每百万 $1.25,salida token 每百万 $9.00。
Cost analysis
| Provider | Cost | Notes |
|---|---|---|
| muapiapp | $1.25/M input tokens, $9.00/M output tokens | Token-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 tokens | 价格以 api.openai.com 的官方定价为准。 |
| Fal.ai | No disponible | GPT Codex is not available on Fal.ai. |
Token-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).
价格以 api.openai.com 的官方定价为准。
GPT Codex is not available on Fal.ai.
** Competitor pricing is estimated based on similar model architectures and usage tiers.
Configuration schema
| Parameter | Type | Description | Default |
|---|---|---|---|
| Prompt | string | 编码任务或指令。 | Implement a binary search tree with insert, delete, and search methods in Python. |
| 模型 | Enum (5 options) | 要使用的 Codex 模型变体。 | gpt-5.4-codex |
| Imagen URL | string | 多模态请求的可选imagen URL。 | undefined |
编码任务或指令。
Implement a binary search tree with insert, delete, and search methods in Python.要使用的 Codex 模型变体。
gpt-5.4-codex多模态请求的可选imagen URL。
undefinedDeveloper documentation
POST /api/v1/gpt-codex — 返回 request_id,通过 /api/v1/predictions/{id}/result 轮询结果。
POST /api/v1/gpt-codex/stream — 返回实时 SSE 流。每个分块格式为:data: {"choices":[{"delta":{"content":"text"}}]},最后以 data: [DONE] 结束。
模型变体(在 model 字段中传入):gpt-5.4-codex(默认,能力最强)、gpt-5.3-codex、gpt-5.2-codex、gpt-5.1-codex、gpt-5-codex。
参见流式文档获取完整代码示例。
Frequently asked
按 token 计费:无论使用哪一种 Codex 模型变体,entrada token 每百万 $1.25,salida token 每百万 $9.00。每次调用的最低费用为 $0.00023。
gpt-5.4-codex 是默认且能力最强的变体。如果简单任务更看重响应速度,可以使用较低版本(gpt-5.3-codex、gpt-5.2-codex 等)。所有变体的价格相同。
`/gpt-codex` 是异步端点——你会收到一个 request_id,然后轮询结果。`/gpt-codex/stream` 返回实时 SSE 流。交互式编程 UI 应使用流式端点;批处理应使用异步端点。
支持。Prompt Caching 允许你以更低费率重复使用常用文本prompt。缓存命中(重复使用先前缓存的 token)按entrada成本的 0.1x 计费。新建缓存(将新 token 写入缓存以供未来重复使用)按标准entrada成本的 1.25x 计费。