Model Gateways
Gateways provide unified access to multiple AI providers through a single API. They offer features like rate limiting, failover, caching, and consolidated billing.
Gateways use a three-part model format: {gateway}/{provider}/{model}. For example, vercel/openai/gpt-5.2 routes to OpenAI’s GPT-4o through Vercel’s gateway.
Quick Reference
| Gateway | Environment Variable | Example Model |
|---|---|---|
| OpenRouter | OPENROUTER_API_KEY | openrouter/anthropic/claude-opus-4.5 |
| Vercel | VERCEL_API_KEY | vercel/openai/gpt-5.2 |
| Netlify | NETLIFY_API_KEY | netlify/anthropic/claude-3-5-haiku-20241022 |
Why Use a Gateway?
| Feature | OpenRouter | Vercel | Netlify |
|---|---|---|---|
| Multiple providers | 200+ models | 86 models | 42 models |
| Unified billing | Yes | Yes | Yes |
| Rate limiting | Yes | Yes | Yes |
| Failover | Yes | Yes | - |
| Caching | - | - | Yes |
| Observability | Yes | Yes | Yes |
Usage
import Ads from 'notpixel';
const ads = new Ads({
publisherId: 'pub_xxx',
model: 'vercel/openai/gpt-5.2', // gateway/provider/model format
input: 'Your user query here',
});
const response = await ads.offer();
console.log(response.text);