/api/router/v1/api_keys
List API keys for the authenticated organization
Returns all active + revoked keys belonging to your organization. The secret token is never returned.
Réponses
-
200API keys
Router remplace
api.openai.com
par une URL unique qui route vers Anthropic, OpenAI, Google, Cohere, Mistral et plus.
Guard filtre les PII, secrets et tokens avant l'envoi. Facturation unique en CAD.
Générez une clé API depuis votre tableau de bord Meridian, puis passez-la dans l'en-tête Authorization de chaque requête.
Authorization: Bearer $ROUTER_API_KEY\nContent-Type: application/json
production), puis copiez-la immédiatement — elle ne sera plus affichée.
ROUTER_API_KEY), dans un gestionnaire de secrets, ou dans votre
.env
local.
Extraite automatiquement depuis la spec OpenAPI servie à /api/router/docs/spec.json. Toute modification dans les contrôleurs se reflète ici dès la prochaine requête.
/api/router/v1/api_keys
Returns all active + revoked keys belonging to your organization. The secret token is never returned.
200
API keys
/api/router/v1/api_keys
Creates a new API key attached to the authenticated organization + the user associated with the calling key. Response includes the **raw token** in the `key` field — **this is the only time it is returned.** Store it immediately. A standard-scope calling key cannot create super_admin keys.
application/json — voir la spec pour le schéma complet.
201
Created
403
Scope escalation blocked
422
Validation error
/api/router/v1/api_keys/{id}
Sets is_active=false on the key. Audit history is preserved; the key can no longer authenticate any request.
id
path
integer
requis
—
200
Revoked
404
Not found
/api/router/v1/api_keys/{id}
Only `name` and `expires_at` are mutable via the API. Scope and user_id are immutable.
id
path
integer
requis
—
application/json — voir la spec pour le schéma complet.
200
Updated
404
Not found
422
Validation error
/api/router/v1/audit
Returns the most recent Guard audits for the authenticated organization, newest first. Supports pagination + filtering. ## Query parameters - `limit` — max rows (default 50, cap 500) - `offset` — skip N (for pagination) - `halted_only` — `true` to only return blocked requests - `min_severity` — `critical|high|medium|low`; at least one detection at or above this level - `from` — ISO-8601 lower bound on inserted_at (inclusive) - `to` — ISO-8601 upper bound (exclusive)
limit
query
integer
— Default 50, max 500
offset
query
integer
—
halted_only
query
boolean
—
min_severity
query
string
—
from
query
string
— ISO-8601 datetime
to
query
string
— ISO-8601 datetime
200
Audit entries
/api/router/v1/audit/{request_id}
Returns the Guard audit row for a specific Router request. `request_id` is the `generation_id` returned in the chat/completions response (available at `result.guard.request_id`) or the `stream-...`/`halt-...` id generated internally for streaming or halted requests. 404 if not found or if the audit belongs to a different organization.
request_id
path
string
requis
— The Router generation_id / audit request_id
200
Audit entry with detections
404
Audit not found
/api/router/v1/billing/balance
Returns your organization's prepaid credit balance in CAD cents.
200
Balance
/api/router/v1/billing/models
Returns every model routable through Router for your organization, with provider and pricing tier. Unrestricted organizations (default) see the whole synced OpenRouter catalog; restricted organizations only see their platform models.
200
Models
/api/router/v1/billing/usage
Returns aggregated usage and a per-model breakdown for the current organization.
200
Usage
/api/v1/chat/completions
Generate a chat completion. Drop-in replacement for `POST https://api.openai.com/v1/chat/completions`. Routes the request through Meridian's Router with Guard anti-exfiltration enabled. Supports `auto` model selection (Router picks the cheapest model meeting your quality bar) or an explicit model id (e.g. `claude-sonnet-4`, `gpt-5`). Set `stream: true` to receive server-sent events with OpenAI-compatible `chat.completion.chunk` payloads terminated by `data: [DONE]`.
application/json — voir la spec pour le schéma complet.
200
Completion result (non-streaming) or SSE stream (streaming)
402
Insufficient credits
403
AI not enabled for organization
429
Rate limited
502
Upstream provider error
/api/v1/chat/completions/estimate
Returns the expected CAD cost of a chat completion without actually calling the upstream model. Uses a `char_count/4` heuristic for prompt tokens and the request's `max_tokens` as the completion budget. Useful for UI budget checks or for clients that need to price per request before consenting to the actual call. Pricing reflects the organization's current markup + FX rate.
application/json — voir la spec pour le schéma complet.
200
Estimate
/api/v1/classify
Deterministic classification with scores. `single` returns probabilities summing to 1; `multi` returns independent 0..1 scores; `binary` answers a yes/no question. Billed at the real cost of the underlying scoring call.
application/json — voir la spec pour le schéma complet.
200
Classification result
/api/v1/embeddings
Generate vector embeddings for a string or a list of strings. Drop-in replacement for `POST https://api.openai.com/v1/embeddings`. Default model is `openai/text-embedding-3-small`. Specify `model` explicitly to use another embeddings model (e.g. `openai/text-embedding-3-large`, `cohere/embed-multilingual-v3.0`).
application/json — voir la spec pour le schéma complet.
200
Embeddings result
402
Insufficient credits
403
AI not enabled for organization
429
Rate limited
502
Upstream provider error
/api/v1/models
Returns the Router model catalog for your organization in OpenAI's list format. Use this endpoint from SDKs that call `client.models.list()`; the richer `/billing/models` endpoint stays available with Meridian-specific fields (tier, display_name, etc.). By default every synced OpenRouter model is listed. An organization can restrict its Router surface to its platform models (`/router/settings/ai`) — restricted orgs only see platform-active models here. Beyond the OpenAI fields (`id`, `object`, `created`, `owned_by`), each entry carries `context_length` (tokens, `null` when unknown), `pricing` (input/output CAD per 1M tokens with your org's markup + FX applied, `null` when the model is unpriced) and `supported_parameters` (what Router accepts for this model).
200
Model list
/api/v1/tools/fetch
Fetches a public `http(s)` URL server-side and returns its integral raw text (tags stripped, never summarized — numbers and units kept as-is), truncated at `max_chars`. HTML yields `title` + absolute `images`; PDFs yield `text` + `pages`. A distant 4xx/5xx returns `200` with the distant `status` and `text: ""`.
application/json — voir la spec pour le schéma complet.
200
Fetched page
/api/v1/tools/web_search
Runs a server-side web search and returns ranked results (`url`, `title`, `snippet`) plus a `billing` cost computed like LLM usage (provider USD cost through the org markup + FX). The backend is env-configurable; without a key the stub backend returns zero results.
application/json — voir la spec pour le schéma complet.
200
Search results
Router est compatible avec les SDK OpenAI officiels (Python, Node, Go) —
changez simplement base_url. Pour un accès, écrivez-nous.