← /docs/integrationsopenai-responses

FlatCompute × Codex CLI

Codex CLI

Connect the OpenAI Codex CLI to FlatCompute's OpenAI-compatible gateway. Unlimited tokens, fixed monthly price, no per-token billing.

FlatCompute speaks the OpenAI Chat Completions API, so any tool that can point at https://api.openai.com/v1 can point at FlatCompute instead — and swap per-token billing for a fixed monthly plan with unlimited tokens.

Configuration

Set these environment variables (or your agent's equivalent config file):

export FLATCOMPUTE_BASE_URL="https://gateway.flatcompute.com/v1"
export FLATCOMPUTE_API_KEY="<FLATCOMPUTE_API_KEY>"
export FLATCOMPUTE_MODEL_ID="qwen3.6:35b-a3b"
export FLATCOMPUTE_PLAN="starter"

Then point your Codex CLI config at the gateway:

{
  "provider": "flatcompute",
  "baseURL": "https://gateway.flatcompute.com/v1",
  "model": "qwen3.6:35b-a3b",
  "apiKeyEnv": "FLATCOMPUTE_API_KEY"
}

Heads up: FLATCOMPUTE_API_KEY must be loaded from your environment only. It is never written into downloaded files or shared client-side.

Quick start

  1. Create an API key in the FlatCompute dashboard.
  2. Subscribe to a plan on the zones page.
  3. Export the environment variables above.
  4. Launch Codex CLI — it will route every request through FlatCompute.

Verifying the connection

curl https://gateway.flatcompute.com/v1/chat/completions \
  -H "Authorization: Bearer ${FLATCOMPUTE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.6:35b-a3b",
    "messages": [{"role": "user", "content": "ping"}]
  }'

A 200 OK with a completion body means you're live on FlatCompute.

Troubleshooting

SymptomFix
401 UnauthorizedRegenerate your API key; ensure FLATCOMPUTE_API_KEY is exported in the shell that launches the agent.
429 Too Many RequestsYou hit your plan's RPM limit. Upgrade your plan or reduce concurrency.
TimeoutsPick a zone closer to you from the zones page, or raise your client timeout.
Wrong modelConfirm FLATCOMPUTE_MODEL_ID matches a model offered by your subscribed zone.

Next steps

FlatCompute × Codex CLI — FlatCompute Docs