Invite & EarnEarn a 10% reward on every subsequent top-up by an invited friend

Codex CLI API · custom provider · BetterToken

Connect Codex CLI to the BetterToken API

Install the official Codex CLI from OpenAI and connect BetterToken as a custom provider through a Responses-compatible API. Create your own BetterToken key, send a test request, and pay for actual usage.

  • You create a BetterToken key, not an official OpenAI API key.
  • Codex CLI is installed separately; BetterToken provides API access.
  • Tokens and charges are visible in Workspace after a request.
Custom provider connectionResponses API
Official Codex CLIInstalled separately
BetterToken APIYour BetterToken key
Responses-compatible APIFor a custom provider
Model, status, tokens, and charge are visible in Workspace

Choose your client and open its instructions

Codex CLI

Install the official CLI from OpenAI. Then connect BetterToken as a custom provider by following the separate command-line instructions.

Configure Codex CLI

Codex VS Code Extension

The extension runs inside VS Code and has its own setup flow. Do not reuse CLI parameters without checking the extension instructions.

Configure the VS Code extension

What you get for working with Codex CLI

BetterToken provides model API access for the official Codex CLI. It does not sell an OpenAI account, a ChatGPT subscription, or an official OpenAI key.

You use your own BetterToken account: create a key, connect it by following the current instructions, and add funds when you plan new tasks.

This flow is for Codex CLI with a custom provider and Responses-compatible API. Applications, SDKs, and other OpenAI-compatible integrations use the separate API page.

Your own BetterToken key

The key is created in your BetterToken account and used for API access. It does not become an official OpenAI API key.

Pay for actual usage

Pay-as-you-go billing. Available payment methods and terms are shown in Workspace. Charges reflect actual model calls.

Review usage in Workspace

After a request, Workspace shows the model, status, input, output, and cached tokens, the related charge, and your remaining balance.

Connect to the BetterToken API

BetterToken provides the API endpoint. A third-party tool’s website, installation, sign-in, extension store, or updates may have separate conditions.

Three steps from key to first request

Create a BetterToken key in Workspace

Register your own BetterToken account or sign in. Create an API key and do not share it in a chat, post, or public file.

Connect the official Codex CLI

Open the current Codex CLI instructions and connect BetterToken as a custom provider through a Responses-compatible API.

Use the instructions for current authorization fields, Base URL, model, and key-selection rules for your client version.

Send a test task and check usage

Launch Codex, send a short task, and confirm that you receive a response. Then open Workspace and check the model, status, tokens, and charge.

Pay for actual usage and review each charge

BetterToken records input, output, and cached tokens according to the selected model’s rules. Usage depends on the model, context, and response size; there is no fixed monthly API charge.

Check models, prices, availability, and key groups on the current pricing page. Available payment methods and terms are shown in Workspace at payment time.

View current pricing
Workspace · API usage
Model
Request status
Input tokens
Output tokens
Cached tokens
Related charge

Frequently asked questions

Key ownership, client choice, billing, and current configuration.

Is this an official OpenAI API key?

No. You create your own BetterToken API key and use BetterToken as a Responses-compatible custom provider for the official Codex CLI. It is not an official OpenAI API key. Follow the current instructions.

Do I receive an account, subscription, or API access?

You receive API access through your own BetterToken account and BetterToken API key. BetterToken does not sell a shared account, ChatGPT subscription, Codex subscription, or official OpenAI account.

How do Codex CLI and the Codex VS Code extension differ?

Codex CLI runs in a terminal; use the CLI instructions. The extension runs inside VS Code and has separate VS Code extension instructions. Choose the document for your client before setup.

Where can I find the current Codex configuration?

Use the current Codex CLI instructions. Select authorization fields, Base URL, model, key group, and credential handling from the document for your client and version.

How does pay-as-you-go billing work?

BetterToken charges your balance for actual model calls under the selected model’s rules. Available payment methods and terms are shown in Workspace at payment time.

Where can I see current models, prices, and key groups?

Use the current pricing page. It lists current models, availability, prices, and key groups.

Where can I see token usage and cost?

BetterToken Workspace shows the balance, model, request time and status, input tokens, output tokens, cached tokens when the model reports them, and the charge for the request.

Is the BetterToken API the same as a general OpenAI-compatible API?

This page covers the Codex CLI connection through its custom provider and Responses-compatible API flow. General SDK, application, and Chat Completions use cases belong to the separate OpenAI-compatible API page and documentation.

Connect the official Codex CLI to BetterToken

Create a BetterToken key in Workspace, choose the documentation for CLI or the VS Code extension, and send a short test request.