API Documentation

OpenAI-compatible API. Drop-in replacement — just change your base URL.

Short answer

APIVAI is a pay-as-you-go API gateway for Claude and GPT. One API key works in two formats: Anthropic Messages at https://api.apivai.com (Claude Code, Anthropic SDK; endpoint /v1/messages) and OpenAI at https://api.apivai.com/v1 (endpoints /v1/chat/completions, /v1/responses and /v1/models). Send the key as Authorization: Bearer or x-api-key, pick a model ID from GET /v1/models, and use streaming for long tasks.

PROXYhttps://api.apivai.com/v1— OpenAI-compatible API endpoint (Claude + GPT)
ANTHROPIChttps://api.apivai.com— Anthropic Messages format (Claude Code, Anthropic SDK), no /v1

Get Started in 2 Minutes

APIVAI provides an API proxy compatible with both Anthropic and OpenAI formats. Just set two environment variables and you're ready to go.

1. Get your API Key

Sign up at apivai.com and top up, then create an API key on the Dashboard page.

2. Set your Base URL

# Anthropic format (Claude Code, Anthropic SDK): https://api.apivai.com # OpenAI format (OpenAI SDK, Cursor, Codex CLI): https://api.apivai.com/v1 # For Anthropic SDK / Claude Code: export ANTHROPIC_BASE_URL="https://api.apivai.com" export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY" # For OpenAI SDK / Cursor: export OPENAI_BASE_URL="https://api.apivai.com/v1" export OPENAI_API_KEY="YOUR_API_KEY"

3. Start using

Claude Code (Mac/Linux)
ANTHROPIC_AUTH_TOKEN="YOUR_KEY" \ ANTHROPIC_BASE_URL="https://api.apivai.com" \ claude
Claude Code (Windows PowerShell)
$env:ANTHROPIC_AUTH_TOKEN="YOUR_KEY" $env:ANTHROPIC_BASE_URL="https://api.apivai.com" claude

If ANTHROPIC_API_KEY is already set in your shell, remove it first, or it is used instead of your APIVAI key: unset ANTHROPIC_API_KEY (PowerShell: Remove-Item Env:ANTHROPIC_API_KEY).

Supported Models
claude-fable-5-1claude-fable-5claude-opus-5claude-opus-4-8claude-opus-4-7claude-opus-4-6claude-opus-5-5claude-sonnet-4-6claude-sonnet-5-5claude-sonnet-5claude-haiku-4-5claude-haiku-5-5gpt-6-astragpt-5.5gpt-5.6-solgpt-5.6-terragpt-6.1-solgpt-6-solgpt-5.6-lunagpt-6-luna