NorthGate AI Gateway
One API endpoint. OpenAI-compatible. 100+ models. Canadian data residency and PIPEDA-aligned audit logging.
01Quickstart
Get from zero to your first API call in under 5 minutes.
Step 1 — Get your API key
Sign up at northgate-ai.polsia.app/auth/signup. Your API key is shown once — store it somewhere safe. Use it in the X-API-Key header on every request.
Step 2 — Make your first request
All examples use the X-API-Key header. Replace YOUR_API_KEY with your actual key.
Step 3 — Try different routing strategies
Add ?route=<strategy> to switch how requests are routed to providers:
02API Reference
Send a chat conversation and receive a model response. Fully OpenAI-compatible — swap your base URL from api.openai.com to northgate-ai.polsia.app and it just works.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| modelrequired | string | Yes | Model ID (e.g. gpt-4o-mini, claude-3-5-sonnet, deepseek-v3). Use ?route= param to let NorthGate choose. |
| messagesrequired | array | Yes | Array of message objects. Each has role (system/user/assistant) and content (string). |
| stream | boolean | No | Enable server-sent events streaming. Default: false. |
| temperature | number | No | Sampling temperature. Range: 0–2. Default: 1.0. |
| max_tokens | integer | No | Maximum tokens in the response. Default: 16384. |
| top_p | number | No | Nucleus sampling. Default: 1. |
| frequency_penalty | number | No | Penalize repeat tokens. Range: -2 to 2. Default: 0. |
| presence_penalty | number | No | Penalize new topics. Range: -2 to 2. Default: 0. |
| tools | array | No | Function calling tools. NorthGate passes through to the upstream provider. |
| response_format | object | No | For structured output ({type:"json_object"}). Requires a system message with "JSON" instruction. |
Response
Streaming response
Convert text to vector embeddings for RAG, semantic search, and similarity matching.
| Field | Type | Required | Description |
|---|---|---|---|
| modelrequired | string | Yes | Embedding model (e.g. text-embedding-3-small, text-embedding-3-large). |
| inputrequired | string | array | Yes | Text string or array of strings to embed. Max 100 strings per call. Max 8,192 tokens per string. |
Returns a list of all models available through NorthGate AI.
Returns the gateway health status. Does not require an API key and does not query the database (safe for Neon auto-suspend).
Prometheus-compatible metrics endpoint. Exposes request counts, latency histograms, error rates, and token usage broken down by model and provider.
03Authentication
API Key Header
Pass your API key on every request using the X-API-Key HTTP header:
Rate Limit Headers
Every response includes rate limit headers so your application can back off gracefully:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Your plan's request limit for the current period (day or month). |
| X-RateLimit-Remaining | Requests remaining in the current period. |
| X-RateLimit-Reset | Unix timestamp when the limit resets. |
| Retry-After | Seconds to wait before retrying, returned only when the limit is exceeded. |
04Routing
Route Strategies
Use the ?route=<strategy> query parameter to control how requests are routed. Each strategy evaluates available providers and picks the best match for the selected criteria.
| Strategy | Best for |
|---|---|
| cheapest | High-volume batch processing, cost-sensitive pipelines |
| fastest | Real-time user-facing features, low-latency requirements |
| balanced | General-purpose API usage — a good default |
| best_quality | High-stakes tasks where output quality is paramount |
Provider List
NorthGate AI currently routes to the following upstream providers:
| Provider | Models available |
|---|---|
| OpenAI | gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, text-embedding-3-small, text-embedding-3-large |
| Anthropic | claude-3-5-sonnet-20240620, claude-3-opus-20240229, claude-3-haiku-20240307 |
| Groq | llama-3.3-70b-versatile, mixtral-8x7b-32768, gemma2-9b-it (free tier) |
| DeepSeek | deepseek-chat (via BYOK or NorthGate provisioned) |
Fallback Behavior
If the primary provider fails or returns an error, NorthGate automatically retries against the next available provider in the fallback chain — with no code changes required from you.
05Pricing
NorthGate AI is priced per seat, not per token. Upstream token costs are passed through at cost — no markup.
Upstream token costs (OpenAI, Anthropic, Groq) are billed by those providers directly — NorthGate AI passes the cost through at no markup. Your plan fee covers gateway access, routing intelligence, Canadian data residency, and PIPEDA audit logs.
See the pricing section on the landing page for full feature comparison.