Claude Code

Claude Code on ModelAPI

One env change. Anthropic Messages API in, OpenAI-compatible apps stay on /v1.

export ANTHROPIC_BASE_URL=https://api.aimodelapi.ai
export ANTHROPIC_API_KEY=sk-ama-YOUR_KEY
  • Do not append /v1 — Claude Code calls /v1/messages itself.
  • Recommended: claude-sonnet-5 or claude-opus-latest.
  • Anthropic-hosted web search is unavailable; local tools work.

Full integration guide · Migrate from Anthropic