Overview
Every request goes to one base URL. Use it anywhere a tool asks for an OpenAI base URL.
Base URL
https://your-site/v1
Supported endpoints are listed below. Streaming works on both chat endpoints.
/v1/responses/v1/chat/completions/v1/modelsCreate an API key
Sign in, add credit from the wallet page, then open API keys and create a key. Each key can have its own spending limit and expiry date, so create one per computer or project.
Go to API keysSet up Codex CLI
Install Codex if you have not already. You need Node.js 18 or newer.
npm install -g @openai/codexThen create or edit these two files in ~/.codex.
model_provider = "waystation"
model = "gpt-6.2-sol"
model_reasoning_effort = "medium"
cli_auth_credentials_store = "file"
[model_providers.waystation]
name = "Waystation"
base_url = "https://your-site/v1"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "sk-your-waystation-key"
}Replace the placeholder with your real key, then run codex in any project folder. The console fills in your real key for you when you click Use with Codex on a key.
Keep model_provider and model at the top of config.toml, before any table. Provider settings placed inside a project table are ignored.
Use an environment variable
Prefer not to store the key in a file? Point the provider at an environment variable instead, and leave auth.json out.
model_provider = "waystation"
model = "gpt-6.2-sol"
model_reasoning_effort = "medium"
[model_providers.waystation]
name = "Waystation"
base_url = "https://your-site/v1"
env_key = "WAYSTATION_API_KEY"
wire_api = "responses"
supports_websockets = false
export WAYSTATION_API_KEY="sk-your-waystation-key"Open a new terminal afterwards so WAYSTATION_API_KEY is picked up.
IDE extension and app
The Codex extension for VS Code, Cursor and Windsurf and the Codex desktop app read the same config.toml and auth.json as the CLI. Set up the files once, then fully restart the extension or app.
If you use the CODEX_HOME environment variable, put both files in that folder instead, and make sure every client points at the same one.
Other clients
Anything that lets you set an OpenAI base URL works too. A quick test from your terminal or code:
curl https://your-site/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-waystation-key" \
-d '{
"model": "gpt-6.2-sol",
"input": "Write a haiku about shipping code."
}'Troubleshooting
- 401 Incorrect API key
- The key in auth.json or your environment variable is wrong, disabled or expired. Copy it again from the API keys page and restart Codex.
- 429 Your balance is used up
- Your balance reached zero or the key hit its spending limit. Redeem a top-up code in your wallet, or raise the key limit.
- 404 Model does not exist
- The model name in config.toml is not offered here. Copy an exact model ID from the pricing page.
- 503 No upstream available
- Every upstream for that model is busy or offline. Wait a minute and try again, or switch to another model.
- Codex still asks you to sign in
- Check that config.toml sets cli_auth_credentials_store to file, that auth.json sits in the same folder, and that auth_mode is apikey.
- Changes do not apply
- Fully quit Codex, including the app and any background process, then start a new session. If you use CODEX_HOME, edit the files in that folder instead.
Every request also shows up on the Usage page of your console with its status and error, which is the fastest way to see what went wrong.