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 atapi.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.
/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
kc_live_…) or a legacy production key (tk_live_… / AKE…).Sandbox
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.$TOKEN, a 1-hour OAuth access token minted once:
Required scope
Every endpoint is gated on theai_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 }:
{ data: [...], meta } with pagination fields:
{ error }:
Pagination
List endpoints acceptpage 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.