Connect your coding agent

Set up once, then choose free and paid models inside your client.

Give this to your agent

Read https://freemodel.io/api/agent/skill?client=codex and help connect my Codex CLI to Free Model. Start READ-ONLY: inspect the version, existing settings and local FREEMODEL_API_KEY. If missing, ask my preferred secure input method and guide private local entry; never expose the key in ordinary chat. Call /api/v1/agent/status and /api/v1/models?tools=true; inspect provider/credit readiness and configure ALL returned free/ and paid/ models in the native model picker. Do not install just one selected model. ASK which client(s) I want configured and whether I confirm the configuration change. WAIT for explicit confirmation before any configuration write; never pick a default for me. After confirmation, BEFORE ANY EDIT back up every file you will modify. Stop if backup fails. Update the normal ~/.codex/config.toml directly for the Free Model connection and full native model list; Codex uses model_catalog_json and Claude uses every modelPicker.options row; no separate free/paid configurations, extra profiles, aliases or launchers. Preserve unrelated settings, permissions, MCP and login; do not edit auth.json. Report backup paths and restoration steps. Never auto-switch to paid. Ask before a generation test, explaining whether it spends credits. Verify that the native /model menu lists ALL returned IDs, then give the normal launch command and explain switching in that menu.
Read the Codex CLI skillfreemodel-codex-setup · SKILL.md

Your agent guides secure key entry on your own machine. The prompt contains no key.

Before anything changes

Read-only first

  1. Check existing settings, your key and account readiness.
  2. Get the full free/ and paid/ model list.
  3. Confirm which client(s) to configure before making changes.

Only after you confirm

  1. Back up your settings. Stop if backup fails.
  2. Add all available models to your normal /model menu.
  3. Give you backup locations and restoration steps.

Generation tests need your consent. Paid models spend credits.

What each model needs

  • free/ · paid/

    Free Model API key

  • free/

    Connected free provider

  • paid/

    Available prepaid credits

    Only needed for paid/ models.

Manual setup and compatibility

Manual configuration

Confirm the change first, then back up every file before editing. Preserve unrelated settings.

~/.codex/config.toml

# Only after user confirmation and a successful backup.
# Merge these root settings and provider fields; keep unrelated settings.
model_provider = "freemodel"
model = "USER_SELECTED_MODEL_ID"
# Save the authenticated GET https://freemodel.io/api/v1/agent/models?client=codex here.
# Replace this with the absolute path in the current user home.
model_catalog_json = "/absolute/path/to/.codex/freemodel-models.json"
web_search = "disabled"
model_context_window = 32768
model_auto_compact_token_limit = 24000

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

Terminal

codex
# In the running session, type /model to choose any configured free/ or paid/ model.