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 API-key-authenticated 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, API-key equivalent and are what the KnoxCall SDKs call.

Base URL

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

Production

Use a production key (tk_live_… or AKE…).

Sandbox

Use a test key (tk_test_…).

Authentication

Authenticate exactly as you do for the rest of the Management API — either a long-lived API key or an OAuth 2.1 access token. See the Authentication guide for the full picture.

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 key. The live/test distinction lives in the phantom token: a token minted with a test key is a test-environment token (kc_test_…), and a token minted with a live key is a live token (kc_live_…). There is no environment parameter on any request — the server derives it from the key you used to mint.

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