Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt

Use this file to discover all available pages before exploring further.

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

# macOS / Linux
nano ~/.codex/config.toml

# Windows
notepad %USERPROFILE%\.codex\config.toml
2

Paste the following

model = "gpt-5.5"
model_provider = "openai-custom"
personality = "pragmatic"
model_reasoning_effort = "high"

[model_providers.openai-custom]
name = "GravitexAI"
base_url = "https://api.gravitex.ai/v1"
wire_api = "responses"

# Custom providers usually need the key injected explicitly:
[model_providers.openai-custom.http_headers]
Authorization = "Bearer YOUR_API_KEY"
Content-Type = "application/json"
3

Launch Codex

cd your-project-folder
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:
Model IDBest forNotes
gpt-5.5Complex reasoning, production codeOpenAI’s latest flagship
gpt-5.4General chat, codegenNext-gen main model for pro tasks
gpt-5.4-proHeavy refactoring / reasoningHigh-performance variant
gpt-5.4-miniBalanced cost & speedGeneral daily dev
gpt-5.4-nanoHigh concurrency / low costLightweight workloads
gpt-5.1-codexCode-focused completionRequires wire_api = "responses"
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 = "pragmatic"
OptionDescription
pragmaticDirect and practical, minimal explanation
conciseShort and to the point
detailedMore context and explanation
analyticalStructured, logic-focused
creativeExpressive and flexible
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.
model_reasoning_effort = "high"
OptionDescriptionBest for
lowFastest responsesQuick Q&A, copy generation
mediumBalanced speed/qualityDay-to-day coding
highDeep reasoningComplex debugging, design, algorithms
Higher reasoning effort costs more time and tokens but markedly improves quality for hard coding and debugging tasks.

5.3 Full example

model = "gpt-5.5"
model_provider = "openai-custom"
personality = "pragmatic"
model_reasoning_effort = "high"

[model_providers.openai-custom]
name = "GravitexAI"
base_url = "https://api.gravitex.ai/v1"
wire_api = "responses"

[model_providers.openai-custom.http_headers]
Authorization = "Bearer sk-your-gravitex-key"
Content-Type = "application/json"
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:
base_url = "https://api.gravitex.ai/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:
[model_providers.openai-custom]
wire_api = "responses"
For custom providers, Codex may not auto-inject OPENAI_API_KEY. Recommended: set Authorization explicitly via http_headers:
[model_providers.openai-custom.http_headers]
Authorization = "Bearer sk-your-key"

7. References