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
| Language | Install | Import |
|---|---|---|
| Python | pip install aigateway-py | from aigateway import AIgateway, AsyncAIgateway, verify_webhook |
| Node / TypeScript | pnpm add aigateway-js | import { AIgateway, verifyWebhook } from "aigateway-js" |
| CLI | npm i -g aigateway-cli | aig init → aig 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
- /integrations/aigateway-python — Python quickstart, async, retries, custom transports.
- /integrations/aigateway-node — Node + TypeScript with typed response envelopes.
- /integrations/cli — CLI scripting, pipelines, MCP server wiring.
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