Skip to main content

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 models

High 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)
Base URL: https://api.gravitex.ai/v1 — must end with /v1.

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

Codex will use the GPT model served by GravitexAI based on this config.
Codex currently supports GPT-family model IDs. The most commonly used combinations on GravitexAI:
Codex supports GPT-family IDs only (e.g. gpt-5.5, gpt-5.4, gpt-5.1-codex). See the full list in the GravitexAI model catalog.

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.
Personality is a soft preference, not strictly enforced. For precise control, use a system prompt.

5.2 Reasoning effort

Controls how much “thinking” the model spends — maps to the reasoning.effort field of OpenAI’s Responses API.
Higher reasoning effort costs more time and tokens but markedly improves quality for hard coding and debugging tasks.

5.3 Full example

This config gives you:
  • Clear, practical answers
  • Deep reasoning for complex tasks
  • Full GPT-5.5 capability via the Responses API

6. FAQ

  1. Re-check your key in the GravitexAI console — beware of stray spaces or newlines.
  2. Confirm the Authorization header is Bearer sk-xxxxxxxxxx.
  3. Make sure your balance is positive.
Make sure the Base URL ends with /v1:
Common mistakes: missing /v1, appending /responses, using http:// instead of https://.
  1. Verify the model ID exists in the GravitexAI model list.
  2. Codex supports GPT-family IDs only (no Claude / Gemini).
  3. Model names are case-sensitive.
gpt-5.1-codex / gpt-5.2-codex and similar Codex models only support the Responses API. Make sure your provider config has:
For custom providers, Codex may not auto-inject OPENAI_API_KEY. Recommended: set Authorization explicitly via http_headers:

7. References