Skip to main content

AI Gateway control plane

The AI Gateway control plane lets you create and manage gateways, agents, and phantom tokens — and read cost/usage — over the public Management API at api.knoxcall.com/v1. These are the same resources you configure in the dashboard, exposed as REST endpoints so you can provision them from code, CI, or the KnoxCall SDKs.
This is the control plane — it configures the gateway. To actually send AI traffic through an agent, call the data plane described in Execute AI Request. The data plane lives on your tenant proxy subdomain and authenticates with a phantom token, not an API key.
The dashboard/admin surface documented on the List Gateways, Create Agent, and Mint Phantom Token pages performs the same operations from a session-authenticated /admin/ai-gateway host. The /v1/ai-gateway endpoints below are the public equivalent and are what the KnoxCall SDKs call.

Base URL

All control-plane endpoints are served under /v1/ai-gateway.

Production

Authenticate with a live-mode OAuth token (kc_live_…) or a legacy production key (tk_live_… / AKE…).

Sandbox

Authenticate with a test-mode OAuth token (kc_test_…) or a legacy test key (tk_test_…).

Authentication

Authenticate exactly as you do for the rest of the Management API. The recommended path is the KnoxCall SDK — which mints, caches, and refreshes short-lived OAuth 2.1 access tokens for you — or a token you mint yourself; long-lived API keys remain supported as the legacy alternative. See the Authentication guide for the full picture.
The x-api-key header is also accepted on the Management API for backwards compatibility, but it is not shown in these examples and new integrations should not use it. Authorization: Bearer is the one header every credential family works with.Neither of these is the data-plane credential. /v1/ai/{slug} takes a phantom token (kp_…) — a different credential family entirely. See Execute AI Request.
The curl examples on the AI Gateway reference pages authenticate with $TOKEN, a 1-hour OAuth access token minted once:

Required scope

Every endpoint is gated on the ai_gateway scope. The action determines the capability your key must hold: A key that lacks the required capability receives 403 with error type forbidden. No other scope grants access to these endpoints.

Response envelope

Every response uses the standard Management API envelope. Single resource{ data, meta }:
List{ data: [...], meta } with pagination fields:
Error{ error }:

Pagination

List endpoints accept page and per_page query parameters and slice the full tenant result set. The meta object returns total, page, per_page, and total_pages.

Sandbox and phantom-token environments

Gateways and agents are not environment-partitioned — the same gateway and agent objects are visible whether you authenticate with a live or a test credential. The live/test distinction lives in the phantom token: a token minted with a test-mode credential is a test-environment token (kp_test_…), and a token minted with a live credential is a live token (kp_live_…). There is no environment parameter on any request — the server derives it from the credential you used to mint. Note the two prefixes are different credential families and are not interchangeable: kc_ is an OAuth 2.1 access token for this Management API, kp_ is a phantom token for the data plane (/v1/ai/{slug}). Presenting one where the other is expected is refused, not translated.

Idempotency

Mutating requests (POST, PATCH, DELETE) honour the router-level X-Idempotency-Key header. Send the same key to retry a request safely without creating duplicates.

Errors

In addition to the shared authentication errors, the control plane returns:

Endpoint index