1. Overview
Codex is OpenAI’s official terminal-based coding agent, designed for code generation, code review and complex engineering tasks. With GravitexAI (OpenAI-compatible) you can:Unified access
Use one API key to reach GPT-5.5 / 5.4 / 5.4-Pro and the whole GPT family
Responses API
Built-in
wire_api = "responses" for the latest GPT modelsHigh availability
Distributed infra with automatic failover and stable global routing
Pay-as-you-go
No subscriptions, token-based billing — better value than the official endpoint
2. Prerequisites
- Codex CLI installed (follow Codex’s official install instructions)
- An API key created in the GravitexAI console (format
sk-xxxxxxxxxx)
3. Quick Setup
Codex uses a TOML config to declare providers. Env vars can be unreliable for custom providers, so we recommend writing the config directly into TOML.Edit ~/.codex/config.toml
1
Open the config
2
Paste the following
3
Launch Codex
4. Recommended Models (via GravitexAI)
Codex currently supports GPT-family model IDs. The most commonly used combinations on GravitexAI:5. Personality & Reasoning
Codex exposes two optional settings to customize behavior: personality and model_reasoning_effort.5.1 Personality
Controls the tone and style of replies.5.2 Reasoning effort
Controls how much “thinking” the model spends — maps to thereasoning.effort field of OpenAI’s Responses API.
5.3 Full example
- Clear, practical answers
- Deep reasoning for complex tasks
- Full GPT-5.5 capability via the Responses API
6. FAQ
401 / invalid API key
401 / invalid API key
- Re-check your key in the GravitexAI console — beware of stray spaces or newlines.
- Confirm the
Authorizationheader isBearer sk-xxxxxxxxxx. - Make sure your balance is positive.
404 / wrong endpoint
404 / wrong endpoint
Make sure the Base URL ends with Common mistakes: missing
/v1:/v1, appending /responses, using http:// instead of https://.Model not found
Model not found
- Verify the model ID exists in the GravitexAI model list.
- Codex supports GPT-family IDs only (no Claude / Gemini).
- Model names are case-sensitive.
chatCompletion error with gpt-5.1-codex
chatCompletion error with gpt-5.1-codex
gpt-5.1-codex / gpt-5.2-codex and similar Codex models only support the Responses API. Make sure your provider config has:Env vars don't seem to work?
Env vars don't seem to work?
For custom providers, Codex may not auto-inject
OPENAI_API_KEY. Recommended: set Authorization explicitly via http_headers:7. References
- GravitexAI console: https://maas.gravitex.ai
- Model catalog: https://maas.gravitex.ai/#/models
- API keys: https://maas.gravitex.ai/#/keys
- OpenAI Responses API: https://platform.openai.com/docs/api-reference/responses
