Connect your coding agent

Choose your tool, copy the prompt, and let your agent check and configure the connection.

Choose your agent

Uses your connected free models, not official Claude or OpenAI models.

Give this to your agent

The prompt contains instructions and public URLs only. Never paste your API key into an agent conversation.

Configure Codex CLI for Free Model using https://staging.freemodel.io/llms-full.txt and the auto model. Read FREEMODEL_API_KEY locally; if missing, help me set it locally without sharing it in chat. Back up and preserve my existing login, settings and permissions. Verify the connection and a tool call, roll back on failure, and give me the launch command.
Get an API key
Manual setup and compatibility

Connect through the stateless Responses endpoint. Function calls and streaming are supported; built-in web search, stored responses and remote compaction are unavailable.

Responses API · ~/.codex/config.toml

Official documentation

Manual configuration reference

Replace MODEL_ID_FROM_MODELS with auto (after confirming tool models are available) or an ID returned by /api/v1/models?tools=true. Merge these settings into the indicated files; keep the API key in your local environment. The Claude example uses Bash/zsh; the setup prompt adapts commands to your shell.

~/.codex/config.toml

[model_providers.freemodel]
name = "Free Model"
base_url = "https://staging.freemodel.io/api/v1"
env_key = "FREEMODEL_API_KEY"
wire_api = "responses"
supports_websockets = false

[model_providers.freemodel.capabilities]
remote_compaction = "unsupported"

~/.codex/freemodel.config.toml

model_provider = "freemodel"
model = "MODEL_ID_FROM_MODELS"
web_search = "disabled"
model_context_window = 32768
model_auto_compact_token_limit = 24000

# Launch after setting FREEMODEL_API_KEY locally:
# codex --profile freemodel

What a working connection must pass

Authenticated model discovery, a text response, SSE streaming, and the target client’s actual tool-call and tool-result round trip. Model names come from your account’s /models response.

Agent API limits: text and client tools; 256 messages; 128 tools; 512,000 characters total; up to 8,192 output tokens. Images, hosted search, stored sessions and extended thinking are unavailable.

Documentation checked October 28, 2026. The prompts recheck your installed version before editing settings.

Plain-text reference for agents