Ana içeriğe geç

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.

AI proxies are created through APIops

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.

Authorization: Bearer YOUR_TOKEN

Permission: API_MANAGEMENT × MANAGE.

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAI API proxy name. Overrides any name carried in the body.

Request Body

FieldTypeRequiredDescription
relativePathstringYesClient-facing path the gateway listens on (for example /ai/chat)
descriptionstringNoFree-text description
llmProviderNamestringNoName of an existing LLM provider connection in the same project. Resolved to its internal reference when the proxy is created.
modelIdstringNoCatalog model id to route to (for example gpt-4o-mini, deepseek-chat)
streamingbooleanNoEnables SSE streaming responses

llmProviderName, modelId and streaming 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
}

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 CodeCondition
400apiProxyName 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
401Token is missing or invalid
500Unexpected server error
{
"status": "FAIL",
"message": "LLM provider (name: openai-prod) was not found in project!"
}

Notes and Warnings

  • References are by name. llmProviderName is 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, not routing. Backend selection, failover, timeouts, mTLS, outbound HTTP proxy and SSL behaviour all live in aiRouting. As a result the routing-dependent settings/* 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.
  • 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.