定價指南

OpenAI Codex 定價:CLI 在 2026 年的實際費用

OpenAI Codex CLI is a free, open-source tool — but it sends every prompt to the OpenAI API, which charges per token. One image compression task burned 7,675 tokens: between 3 and 11 cents. The default model, codex-mini-latest, costs $1.50 per million input tokens and $6.00 per million output tokens. Pointing Codex at RunAPI instead cuts those rates by 50%, with no other changes to your workflow.

更新於 June 23, 2026 RunAPI Editorial
快速概覽

OpenAI Codex 費用是多少?

The Codex CLI itself is free to download and run. The cost comes from API calls: every prompt, file read, and code generation goes to the OpenAI API. The default model is codex-mini-latest, priced at $1.50/1M input tokens and $6.00/1M output tokens through OpenAI directly. A moderate coding session — roughly 8M input and 2M output tokens per month — runs about $24 with OpenAI. The same usage through RunAPI costs $12. RunAPI is OpenAI-compatible, so you change two environment variables and nothing else. Tip: run /compact during long sessions to free up context and stop burning tokens on conversation history.

Codex CLI 免費

CLI 本身沒有訂閱費用。您只需為每次程式開發工作階段消耗的 API Token 付費。

OpenAI 直接——每百萬 Token $1.50 / $6.00

codex-mini-latest 輸入費用為每百萬 Token $1.50,輸出費用為每百萬 Token $6.00(透過 OpenAI API)。

RunAPI——每百萬 Token $0.75 / $3.00

RunAPI 以五折優惠提供相同模型。設定兩個環境變數,Codex 就會自動路由到 RunAPI。

無訂閱綁定

只為實際使用量付費。沒有每月座位費。沒有最低消費。停止程式開發時帳單立即停止。

計費方式

什麼會被計算為 Token?

Every message Codex sends to the API includes your prompt, the full context of files it has read, any tool results, and conversation history. That combined input is tokenized (roughly 750 words per 1,000 tokens). The model's response — edited code, explanations, next steps — counts as output tokens. Both directions are billed separately. Codex caches nothing between sessions, so a fresh session re-reads the same files and bills that context again. One real example from a developer testing image compression — a single 5 MB file task burned 7,675 tokens, or roughly 3 to 11 cents. Not very cheap for one file, but most coding sessions stay well under a dollar each.

價格比較

codex-mini-latest 定價:OpenAI vs RunAPI

價格以每百萬 Token 美元計算。RunAPI 費率為 OpenAI 定價的 50%。

每月費用情境

一個月通常需要多少費用?

基於 codex-mini-latest,OpenAI 定價 $1.50/$6.00,RunAPI 定價 $0.75/$3.00(每百萬 Token)。

設定指南

如何將 Codex CLI 與 RunAPI 搭配使用

1

安裝 Codex CLI

2

建立 RunAPI 帳戶

3

設定環境變數

4

運行 Codex

5

驗證模型

常見問題

關於 Codex 定價的常見問題

相關內容

繼續探索

設定兩個環境變數,每個 Codex 工作階段即可透過 RunAPI 以 OpenAI 定價的 50% 運行。無需訂閱,無最低消費——只為使用的 Token 付費。