Create AI API Proxy
Endpoint
POST /apiops/projects/{projectName}/apiProxies/ai/{apiProxyName}/
Creates an API proxy of type AI. AI proxies forward traffic to an LLM provider (OpenAI, Anthropic,
DeepSeek, Azure OpenAI, self-hosted vLLM/Ollama, …) instead of a classic backend address.
This is the APIops-native way to create an AI proxy. The classic /apiProxies/url/ and
/apiProxies/file/ endpoints produce REVERSE_PROXY / OPEN_API / WSDL proxies and cannot
produce type=AI.
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Permission: API_MANAGEMENT × MANAGE, or AI_DEVELOPMENT × MANAGE.
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | AI API proxy name. Overrides any name carried in the body. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| relativePath | string | Yes | Client-facing path the gateway listens on (for example /ai/chat) |
| description | string | No | Free-text description |
| llmProviderName | string | No | Name of an existing LLM provider connection in the same project. Resolved to its internal reference when the proxy is created. |
| modelId | string | No | Id of a model of the LLM provider to route to (for example gpt-4o-mini, deepseek-chat) |
| streaming | boolean | No | Enables SSE streaming responses. When clientStreamPresentBehavior is USE_CLIENT, it applies only to requests that carry no stream field |
| clientStreamPresentBehavior | string | No | What the gateway does when the request body carries a stream field. USE_CLIENT: the client's stream value decides between a streaming (SSE) response and a single response. OVERWRITE: the streaming setting of the proxy always wins. Default USE_CLIENT for a proxy created through this endpoint |
llmProviderName, modelId, streaming and clientStreamPresentBehavior populate the proxy's primary aiRouting
configuration. They are optional at creation time — a proxy may be created first and routed
afterwards through Update AI Routing or the Manager UI.
Full JSON Body Example
{
"relativePath": "/ai/chat",
"description": "Customer support assistant",
"llmProviderName": "openai-prod",
"modelId": "gpt-4o-mini",
"streaming": false,
"clientStreamPresentBehavior": "USE_CLIENT"
}
Minimal Body Example
{
"relativePath": "/ai/chat"
}
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"deploymentResult": {
"success": false,
"detailList": []
}
}
Creation does not deploy the proxy. Deploy it separately with
POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/environments/{environmentName}/.
Error Responses
| HTTP Code | Condition |
|---|---|
| 400 | apiProxyName is empty, request body is missing, relativePath is empty, an API proxy with the same name already exists in the project, or llmProviderName does not match any LLM provider in the project |
| 401 | Token is missing or invalid |
| 500 | Unexpected server error |
{
"status": "FAILURE",
"resultMessage": "LLM provider (name: openai-prod) was not found in project!"
}
Notes and Warnings
- References are by name.
llmProviderNameis the provider connection's name, not its identifier. APIops never accepts or returns raw object identifiers, because they are not portable between installations. - AI proxies use
aiRouting, notrouting. Backend selection, failover, timeouts, mTLS, outbound HTTP proxy and SSL behaviour all live inaiRouting. As a result the routing-dependentsettings/*endpoints (circuit breaker, proxy server, mTLS, NTLM, connection, error handling, custom message, gRPC, WebSocket, addresses, routing status, metadata) reject AI proxies with HTTP 400 and point to Update AI Routing instead. - Client
streamfield. WithUSE_CLIENT, a client that sendsstream: truereceives a streaming response and a client that sendsstream: falsereceives a single response; a request without astreamfield followsstreaming. A client can switch streaming on only when the proxy has no policy that works on a single response only (Groundedness Guard, MCP or A2A tool call, inline PII unmask, an external guardrail engine on DLP, Topic or PII, Topic Guard together with DLP blocking); otherwisestreamingapplies.streamis read for chat and responses requests only. - Proxy-level settings still apply. CORS, cache, idempotency, error templates, forwarded-IP header, spec access type, client route, API keys, maintenance mode, trace and traffic-log settings work on AI proxies exactly as they do on classic proxies.
- Policies are attached the same way as for any other proxy, through
POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/. All AI policy types (PII masking, prompt guard, token rate limit, semantic cache, DLP guard, loop guard, topic guard, RAG injection, MCP tool call, A2A agent call, …) are supported.