Developer documentation

Integrate AIGate in minutes

AIGate exposes an OpenAI-compatible API, so you can plug it into your existing tooling with minimal changes. Use one base URL, one API key, and route requests to multiple providers.

Overview

AIGate gives you a unified OpenAI-compatible endpoint for multiple models and providers. You keep your app logic simple while AIGate handles routing, quota tracking, metering, and request logging.

Base URL
https://cheapapikey.net/v1
Protocol
OpenAI-compatible
Auth
Bearer API key

Authentication

Create an API key from your dashboard, then send it as a Bearer token with every request.

Authorization: Bearer aigate-your-api-key

You can manage API keys at /dashboard/keys. New keys are only shown once when created.

Quickstart

Set your environment variables and make your first request.

export OPENAI_API_KEY="aigate-your-api-key"
export OPENAI_BASE_URL="https://cheapapikey.net/v1"

curl $OPENAI_BASE_URL/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.6",
    "messages": [
      {"role": "user", "content": "Hello from AIGate"}
    ]
  }'

Claude CLI Provider Switch

Want Claude CLI to use AIGate as the provider? Copy one command below, replace YOUR_AIGATE_KEY, and run it in your terminal.

Default Claude model mapping
  • Haiku (Fast)claude-haiku-4.5
  • Sonnet (Default)claude-sonnet-4.6
  • Opus (Powerful)claude-opus-4.7
macOS / Linux
curl -fsSL https://cheapapikey.net/install/claude.sh | bash

One-line installer. It only asks for your API key, then automatically configures all 3 Claude models and creates helper commands: claude-haiku, claude-sonnet, claude-opus.

Windows PowerShell
irm https://cheapapikey.net/install/claude.ps1 | iex

One-line installer. It only asks for your API key, then automatically configures all 3 Claude models and creates helper commands: claude-haiku, claude-sonnet, claude-opus.

Windows CMD
powershell -ExecutionPolicy Bypass -Command "irm https://cheapapikey.net/install/claude.ps1 | iex"

For CMD users, this launches the same PowerShell installer in one line.

VSCode Integration

If you use Claude inside VSCode terminal, run the one-line installer first, then completely close and reopen VSCode so the integrated terminal picks up the new environment variables.

Recommended flow
  • • macOS/Linux: curl -fsSL https://cheapapikey.net/install/claude.sh | bash
  • • Windows PowerShell: irm https://cheapapikey.net/install/claude.ps1 | iex
  • • Then fully close VSCode and open it again.
  • • Open a new integrated terminal and use: claude-haiku, claude-sonnet, or claude-opus.
If VSCode still uses old provider
# Check env inside VSCode terminal
# macOS / Linux
printf "%s
" "$OPENAI_BASE_URL" "$AIGATE_MODEL"

# PowerShell
$env:OPENAI_BASE_URL
$env:AIGATE_MODEL

Expected base URL: https://cheapapikey.net/v1. If values are empty, restart VSCode completely and open a new terminal tab.

Chat Completions

Use the standard OpenAI chat completions format.

POST /v1/chat/completions

{
  "model": "claude-opus-4.6",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Write a short welcome message."}
  ],
  "temperature": 0.7,
  "max_tokens": 512,
  "stream": true
}

List Models

Query the available models for the current API key.

curl $OPENAI_BASE_URL/models \
  -H "Authorization: Bearer $OPENAI_API_KEY"

See the visual catalog on the models page.

SDK Examples

Python
from openai import OpenAI

client = OpenAI(
    api_key="aigate-your-api-key",
    base_url="https://cheapapikey.net/v1"
)

resp = client.chat.completions.create(
    model="claude-opus-4.6",
    messages=[{"role": "user", "content": "Hi!"}]
)

print(resp.choices[0].message.content)
Node.js
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'aigate-your-api-key',
  baseURL: 'https://cheapapikey.net/v1',
});

const resp = await client.chat.completions.create({
  model: 'claude-opus-4.6',
  messages: [{ role: 'user', content: 'Hi!' }],
});

console.log(resp.choices[0].message.content);

Integration Notes

  • • Generate API keys from /dashboard/keys.
  • • Use /v1/models to dynamically discover what is enabled.
  • • Request logs and token usage appear in your dashboard after each call.
  • • Admins can configure upstream providers and model mappings in /admin.