Skip to main content
POST
Create an AI gateway
Creates a gateway. slug must be 2–64 lowercase alphanumerics or hyphens, starting and ending with an alphanumeric; anything else is 422 invalid_slug, and a slug already in use is 409 conflict. Creating a gateway also seeds a Default prompt-firewall policy for the tenant if one does not exist yet, and Create an agent attaches it when the caller names no firewall_policy_id. That default policy’s action is warn, deliberately: a policy silently inherited by every future agent must not be able to start refusing their traffic. So blocking is opt-in either way — change the Default policy’s action, or attach one of your own with action: "block". See Prompt firewall.
The dashboard twin. The same operation exists on the admin host as POST /admin/ai-gateway, session-authenticated with an X-Tenant-ID header and an owner/admin role. That is what the dashboard itself calls. Prefer the /v1 operation above for anything you write: it is the surface the five SDKs, the Postman collection and this spec cover.

Authorizations

Authorization
string
header
required

OAuth 2.1 authentication — recommended for new integrations. Access tokens (kc_ prefix) are minted at the root-host token endpoint https://api.knoxcall.com/oauth/token and passed as Authorization: Bearer <access_token>. Public clients must use PKCE with the authorization_code grant; confidential clients may use client_credentials. The first-party SDKs and the knoxcall login CLI handle token minting, caching, refresh, and DPoP for you.

Body

application/json
name
string
required
slug
string
required

Unique machine handle within the tenant.

description
string | null
budget_daily_usd
number | null
budget_monthly_usd
number | null
budget_overage_action
enum<string>

What happens when the gateway's cap is spent (AIGW-150). Defaults to block. No fallback — that action swaps an agent's route and model, which a gateway does not have.

Available options:
block,
warn

Response

The created gateway.

data
object

An AI gateway — the top-level container that agents are created under.

meta
object

Metadata included with every API response.