Skip to main content

AI Coding Tools

Point Codex, Claude Code, or OpenCode at Meto AI with one API key. Replace the official provider base URL with Meto AI and keep using the same tool workflows.

Tool versions change quickly. Prefer the steps below, and check each tool's official docs if a config key moves.

Before you start​

  1. Create an account at metotoken.ai
  2. Create an API key in Dashboard → API Keys
  3. Confirm model IDs with Models or GET /v1/models
  4. Keep keys in environment variables or the tool's auth store — never commit them to git
ItemValue
API host / Claude Messageshttps://api.metotoken.ai
OpenAI-compatible base URLhttps://api.metotoken.ai/v1
AuthAuthorization: Bearer YOUR_API_KEY

Meto AI exposes the formats these tools need:

  • OpenAI Chat Completions — /v1/chat/completions
  • OpenAI Responses — /v1/responses
  • Claude Messages — /v1/messages

Codex CLI​

Codex talks to Meto AI over the Responses API (/v1/responses). Put provider settings in the user-level config:

  • macOS / Linux: ~/.codex/config.toml
  • Windows: %USERPROFILE%\.codex\config.toml

Project-local .codex/config.toml cannot override provider or base URL settings; Codex ignores those keys there.

Option A — Override the built-in OpenAI base URL​

openai_base_url = "https://api.metotoken.ai/v1"

Set your OpenAI-compatible API key the way Codex expects for API-key login (for example OPENAI_API_KEY), using your Meto AI key as the value.

model = "gpt-4o-mini"
model_provider = "metotoken"

[model_providers.metotoken]
name = "Meto AI"
base_url = "https://api.metotoken.ai/v1"
env_key = "METOTOKEN_API_KEY"
wire_api = "responses"
requires_openai_auth = false

Then export the key:

export METOTOKEN_API_KEY="YOUR_API_KEY"

Replace gpt-4o-mini with a model ID enabled on your account. Do not reuse the reserved provider IDs openai, ollama, or lmstudio for a custom block — define a new id such as metotoken.

Verify​

codex

Send a short prompt and confirm usage appears in the Meto AI dashboard.

Official reference: Codex configuration


Claude Code​

Claude Code uses the Anthropic Messages API. Meto AI serves it at /v1/messages, so set ANTHROPIC_BASE_URL to the host only (do not append /v1).

Shell (current session)​

export ANTHROPIC_BASE_URL="https://api.metotoken.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"

ANTHROPIC_AUTH_TOKEN is sent as Authorization: Bearer …. If your setup expects the Anthropic x-api-key header instead, use ANTHROPIC_API_KEY with the same Meto AI key.

Optional model defaults:

export ANTHROPIC_MODEL="claude-sonnet-4-5"
export ANTHROPIC_SMALL_FAST_MODEL="claude-haiku-4-5"

Use model IDs that appear in your Meto AI model list.

Persistent settings​

Add the same variables to ~/.claude/settings.json (or a project .claude/settings.json):

{
"env": {
"ANTHROPIC_BASE_URL": "https://api.metotoken.ai",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY"
}
}

Settings-file env values apply across Claude Code sessions. Prefer a secret store or apiKeyHelper if you do not want the key on disk.

Verify​

Inside Claude Code, run /status and confirm:

  • Anthropic base URL points at https://api.metotoken.ai
  • Auth shows ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY, not only a claude.ai login

Official reference: Claude Code LLM gateway


OpenCode​

OpenCode can call any OpenAI-compatible gateway through a custom provider in opencode.json.

Config locations (later files override earlier ones):

  • Global: ~/.config/opencode/opencode.json
  • Project: opencode.json or .opencode/opencode.json

Example opencode.json​

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"metotoken": {
"npm": "@ai-sdk/openai-compatible",
"name": "Meto AI",
"options": {
"baseURL": "https://api.metotoken.ai/v1"
},
"models": {
"gpt-4o-mini": {
"name": "GPT-4o mini"
},
"claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5"
}
}
}
}
}

Notes:

  • npm: use @ai-sdk/openai-compatible for /v1/chat/completions. If a model must use /v1/responses, use @ai-sdk/openai instead (or per-model overrides as documented by OpenCode).
  • models keys must match Meto AI model IDs exactly.
  • You can set "apiKey": "{env:METOTOKEN_API_KEY}" under options, or register the key with auth.

Auth​

opencode auth login

Choose Other, use provider id metotoken, and paste your Meto AI API key.

Verify​

opencode

Select a Meto AI model and run a short prompt; check usage in the dashboard.

Official reference: OpenCode providers


Troubleshooting​

SymptomWhat to check
401Key missing, wrong env var name, or revoked key
403Insufficient balance, model not enabled, or account restrictions
Codex ignores custom base URL in a repoProvider keys belong in ~/.codex/config.toml, not project config
Claude Code still hits AnthropicANTHROPIC_BASE_URL unset, or set to …/v1 by mistake — use host only
OpenCode cannot find the providerProvider id in opencode.json must match the id used in opencode auth login; include a models block
Model not foundCall GET /v1/models and use an ID enabled for your account

More status meanings: Errors

Security​

  • Store keys in env vars, OS secret stores, or the tool's auth command — not in committed config
  • Rotate keys in the dashboard if a machine or repo may have leaked them
  • Use separate keys for personal tools vs. shared CI

Next steps​