Your first API call

AIGateway speaks the OpenAI API format. Change base_url and every model is reachable from the OpenAI or Anthropic SDK.

Connection details

PARAMVALUE
base_url (OpenAI)https://api.aigateway.ltd/v1
base_url (Anthropic)https://api.aigateway.ltd/anthropic
api_keyCreate one in the console (starts with sk-)
modelauto / deepseek-flash / qwen-plus / qwen-max / qwen-flash

First request

curl https://api.aigateway.ltd/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${AIGATEWAY_API_KEY}" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'
With model set to "auto", the gateway picks a tier based on request complexity and bills at the model actually used. Simple prompts can cost 90% less than pinning a flagship model.

Plugging in agent tools

Claude Code, GitHub Copilot, OpenCode and Cursor can all use AIGateway as their model backend with no code: pick “OpenAI-compatible provider” in the tool's model settings and enter the base_url and api_key. See “Agent tools” for details.