All models, capabilities, and prices

Troubleshooting

Twelve concrete failure modes we see week-in, week-out. Symptom → cause → one-line fix.

Before you start
Run curl -s https://api-ai.app/v1/models -H "x-api-key: $ANTHROPIC_API_KEY". If it returns a non-empty JSON model list, your network reach and auth are fine — whatever you’re hitting is request-specific, not infrastructure.

Top questions

Do I need to log into Claude Code?

No. The API key works without logging into a Claude Code account. If Claude Code shows a login prompt, you can skip it or sign in with any account — it does not affect your API-AI key. Requests go through ANTHROPIC_BASE_URL + ANTHROPIC_API_KEY, not the OAuth token.

To suppress the login prompt entirely, clear the OAuth token in your current shell:

bash
# macOS / Linux
unset ANTHROPIC_AUTH_TOKEN

# Windows PowerShell
Remove-Item Env:\ANTHROPIC_AUTH_TOKEN

# Windows cmd
set ANTHROPIC_AUTH_TOKEN=

Then restart Claude Code. If the login screen still appears, the variable is also set in your shell rc — check and clean it up:

bash
grep -nE 'ANTHROPIC_AUTH_TOKEN' ~/.zshrc ~/.bashrc 2>/dev/null

Do I need to log into ChatGPT for Codex CLI?

No. Codex CLI reads OPENAI_BASE_URL and OPENAI_API_KEYfrom the environment. When both point to API-AI, Codex bypasses the ChatGPT sign-in entirely and talks to our endpoint. So you can skip the auth screen.

If a stale token or shell-rc export gets in the way:

bash
unset OPENAI_API_KEY
rm -f ~/.codex/auth.lock
# then re-export the values for your key and restart codex
export OPENAI_BASE_URL="https://api-ai.app/v1"
export OPENAI_API_KEY="mdf-..."
codex

Full walkthrough on the Codex (OpenAI) page.

Do I need a VPN? Any regional restrictions?

No VPN is needed — API-AI has no regional restrictions. The endpoint api-ai.app does not block any country.

Worse, VPN / VLESS proxies often break the API connection in two ways:

  • SSE streaming is buffered inside the proxy — the stream gets cut off mid-token.
  • HTTP/2 + ALPN negotiation breaks at relay hops — the client sees connection reset.

If you’re seeing cut-off streams, connection reset, or random timeouts, disable the VPN / VLESS proxy and retry. Our gateway does no buffering.

JSON parse error in config (or a 429)

The most common cause is “smart” quotes (“ ”) in your JSON config. They appear when you copy from a messenger, Notion, Google Docs, or a browser that auto-replaces ASCII quotes with typographic ones. JSON parsers only accept plain ASCII ".

Sometimes a broken config doesn’t surface as “JSON parse error” but as a 429 — the client interprets upstream silence as a rate limit. Same fix:

  • Replace every “ ” with " by hand.
  • Copy configs directly from this documentation — the quotes are already correct here.
  • Validate with cat -v config.json or jq . config.json — both flag the bad byte.
bash
# Quick check: jq fails on the first smart quote
jq . ~/.claude/settings.json

# Auto-replace smart quotes with straight quotes
sed -i.bak 
  

s/[\u201c\u201d]/"/g' ~/.claude/settings.json

Symptom matrix

Reference data
SymptomLikely causeFix
401 authentication_error on every requestKey is unset, malformed, or has a stray newline / quote from a copy-paste.echo "${ANTHROPIC_API_KEY:?missing}" | wc -c # expect 53 (mdf- + 48 hex + newline)
Suddenly a 401 or 402 on a key that worked yesterdayA 402 means the balance is at zero. A 401 means the key has expired, been restricted or been renewed.Check balance via admin@minedom-france.fr or the dashboard; if zero, top up.
403 permission_denied on /v1/messages but /v1/models worksThe key was restricted, or a recent renewal revoked the old key.Message admin@minedom-france.fr — usually a 30s fix.
404 not_found_error on /v1/chat/completionsOld base URL — you're hitting /chat/completions without /v1.Set base_url to https://api-ai.app/v1 (with /v1).
429 rate_limit_error in spikesPer-key concurrency burst.Respect Retry-After. Lower max parallelism in your worker pool.
400 invalid_request_error: model "…" is not availableModel name is not in the canonical list (e.g. claude-3-5-sonnet, or claude-haiku-4-5 without the date).Use a current id from /docs/api/models — the 400 response itself lists the supported ids. The gateway validates the model before the upstream.
503 'no available accounts' that clears in under a minuteReal, temporary saturation of upstream capacity.Exponential backoff (500ms / 1s / 2s). Stop after 3 attempts.
504 timeout after exactly 60–120s on a non-streaming callLong generation (big context + tools). Upstream takes >60s to emit headers.Pass stream:true. message_start arrives in ~100ms, so the header-timer never trips.
Tool call replaced with prose ('I would have called X...')Client sent tool_choice:{any|tool} → gateway rewrote to auto + hint; model didn't take the hint.Tighten the user prompt ("Use the X tool to do Y"), or switch to a stronger model.
OPENAI_API_KEY is overriding my API-AI keyAn old export in your shell rc (~/.zshrc, ~/.bashrc) shadows the new value.unset OPENAI_API_KEY in this shell, then grep -nE 'OPENAI_API_KEY' ~/.zshrc and clean it up.
Codex says 'Invalid API key' even though auth.json is setCodex prefers shell-exported OPENAI_API_KEY over ~/.codex/auth.json.unset OPENAI_API_KEY; rm -f ~/.codex/auth.lock; restart codex. See /docs/clients/codex.
Cursor / Claude Code: streaming response gets cut off mid-tokenAlmost always a client-side network proxy or VPN buffering SSE chunks.Disable the proxy/VPN, retry. Our gateway uses flush_interval=-1 — no buffering at our edge.

Diagnostic one-liners

If the symptom matrix didn’t hit your case, capture these three pieces of evidence:

bash
# 1. Confirm reach + auth
curl -sS -o /dev/null -w "HTTP %{http_code}  total %{time_total}s\n" \
  https://api-ai.app/v1/models -H "x-api-key: $ANTHROPIC_API_KEY"

# 2. Reproduce the failing call with -v (verbose headers)
curl -sv https://api-ai.app/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-sonnet-5-5","max_tokens":32,"messages":[{"role":"user","content":"hi"}]}'

# 3. Check your current balance — via admin@minedom-france.fr or the dashboard
#    (an HTTP balance endpoint is coming later)

When to escalate

Send the three outputs above + the first 8 characters of your key + a UTC timestamp to admin@minedom-france.fr. That’s enough for us to find your request in the gateway log within minutes. See Get support for what we don’t need (and never ask for).

Last updated: October 2, 2026Found a bug? admin@minedom-france.fr