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.

Uninstall / Reset to default
# Windows PowerShell
irm https://cheapapikey.net/install/claude-uninstall.ps1 | iex

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

Removes all environment variables and helper commands created by the installer, restoring your Claude terminal setup to its previous/default state after reopening terminal or VSCode.

Codex for VSCode

Configure Codex/OpenAI-compatible tools in VSCode to use your cheapapikey.net API key. This uses a separate installer from Claude.

Default Codex mapping
  • Defaultchatgpt5.5
  • Fast helperchatgpt5.4
  • Base URLhttps://cheapapikey.net/v1
Windows PowerShell install
irm https://cheapapikey.net/install/codex-vscode.ps1 | iex

One-line installer. It asks for your API key, sets OpenAI-compatible environment variables, and creates helper commands: codex-aigate and codex-fast.

Windows CMD install
powershell -ExecutionPolicy Bypass -Command "irm https://cheapapikey.net/install/codex-vscode.ps1 | iex"
Uninstall / Reset Codex config
# Windows PowerShell
irm https://cheapapikey.net/install/codex-vscode-uninstall.ps1 | iex

# Windows CMD
powershell -ExecutionPolicy Bypass -Command "irm https://cheapapikey.net/install/codex-vscode-uninstall.ps1 | iex"

Removes Codex/OpenAI environment variables and helper commands created by this installer. Close and reopen VSCode after install/uninstall.

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.