View as /docs.md
Reference

SDKs + CLI

For chat / embeddings / images / STT / TTS, the official openai package works unchanged — set base_url to ours. When you need the aggregator-native primitives — async jobs, sub-accounts, evals, replays, signed file URLs, webhook signature verification — install the typed AIgateway SDK.

Install

LanguageInstallImport
Pythonpip install aigateway-pyfrom aigateway import AIgateway, AsyncAIgateway, verify_webhook
Node / TypeScriptpnpm add aigateway-jsimport { AIgateway, verifyWebhook } from "aigateway-js"
CLInpm i -g aigateway-cliaig initaig call / aig models / aig mcp call

The PyPI distribution is aigateway-py (not aigateway); the import path stays aigateway. The npm SDK is aigateway-js; the CLI binary is aig.

Per-tool recipes

Using the OpenAI SDK

If you already have OpenAI SDK code, the migration is a single constant:

from openai import OpenAI
client = OpenAI(
    base_url="https://api.aigateway.sh/v1",
    api_key=os.environ["AIG_KEY"],
)
# everything else is the same OpenAI SDK you already know