CODEX
Codex base URL
Create an API key for GPT / Codex, add Half API as a Codex provider, and keep using Codex. Standard and Premium are chosen in the console.
Quickstart
- 1. Create an accountSign up with email at app.halfapi.com.
- 2. Pay with USDTMinimum top-up is $1. Credits are added when the payment completes.
- 3. Create an API key for GPT / CodexCopy the
sk-secret. Choose Standard or Premium in the console. - 4. Point Codex at Half APIAdd the provider in
~/.codex/config.toml, then export the key.
Configure Codex
| Field | Value |
|---|---|
| Base URL | https://api.halfapi.com/v1 |
| API key env | HALFAPI_KEY |
| Model | A name from the console list |
# ~/.codex/config.toml
model_provider = "halfapi"
[model_providers.halfapi]
name = "Half API"
base_url = "https://api.halfapi.com/v1"
env_key = "HALFAPI_KEY"
export HALFAPI_KEY="sk-..."
codex
Codex App may not show a Base URL field. Use the config file above, then restart Codex.
Try it
Quit Codex completely after saving the config. Open it again and send a short prompt. If it fails, confirm HALFAPI_KEY is set, the provider name matches, and the payment has completed.
Troubleshooting
- Base URL
- Set base_url to https://api.halfapi.com/v1 in ~/.codex/config.toml.
- Wrong key
- Codex needs a GPT / Codex key. A Claude key will not work here.
- USDT
- Payments are final once the gateway marks them complete.
- Standard vs Premium
- These are console options. They do not change the model names on the console list.