Skip to main content

Create agent

POST /admin/ai-gateway/{gatewayId}/agents
This is a control-plane endpoint on the admin host (admin.knoxcall.com). Authenticate with a session JWT, send the X-Tenant-ID header, and use an owner or admin account — it is not an api.knoxcall.com API-key endpoint. Request body
{
  "name": "Customer Support Bot",
  "slug": "support-bot",
  "provider": "anthropic",
  "upstream_secret_id": "00000000-0000-0000-0000-000000000000",
  "description": "Handles tier-1 support questions",
  "default_model": "claude-sonnet-4-6",
  "budget_daily_usd": 10.00,
  "budget_monthly_usd": 200.00,
  "streaming_enabled": true
}
Create fields
FieldTypeDescription
namestringRequired. Display name for the agent.
slugstringRequired. URL slug; the agent is served at /v1/ai/{slug}.
provideranthropic | openaiRequired. Upstream provider. Determines the upstream URL and auth header template.
upstream_secret_idstring (uuid)Required. ID of a secret in this tenant holding the provider API key. The gateway auto-creates an upstream route (ai-gateway-{slug}) wired to this secret.
descriptionstringOptional free-text description.
default_modelstringOptional. Defaults to the provider default (claude-sonnet-4-6 for Anthropic, gpt-4o for OpenAI).
budget_daily_usdnumberOptional daily spend cap.
budget_monthly_usdnumberOptional monthly spend cap.
streaming_enabledbooleanOptional. Defaults to true.
The primary route is derived automatically from provider + upstream_secret_id; you do not pass primary_route_id at create time. Model policy (model_allowlist, model_denylist, model_rewrite), tool_allowlist, output_schema / output_validation_action, fallback_route_ids, and firewall_policy_id are configured after creation via PATCH /admin/ai-gateway/{gatewayId}/agents/{agentId} — they are not read by the create handler.