Skip to main content

Proxy API Reference

The proxy API is the caller-facing surface AISIX exposes on the proxy listener. Applications send requests in the format they already use, and AISIX applies authentication, model resolution, traffic controls, and provider dispatch.

This reference covers AISIX route behavior, authentication, model discovery, routing, and endpoint constraints. Proxy request and response bodies follow the API family used by each route, so use the upstream API reference when you need the full body schema.

In AISIX, client-facing route paths are fixed by the AI API shape rather than custom-defined for each upstream. Applications call the supported proxy endpoints directly. The request model value selects the configured AISIX model alias, which decides the provider key, upstream model, routing behavior, and traffic controls behind the request.

Proxy Routes

MethodRouteDescription
GET/v1/modelsList model aliases visible to the caller API key. Multi-target aliases are hidden.
POST/v1/chat/completionsOpenAI-compatible chat completions. Broadest provider support.
POST/v1/completionsOpenAI-compatible text completions.
POST/v1/messagesAnthropic-style messages. Native for Anthropic upstreams; translated for non-Anthropic upstreams.
POST/v1/messages/count_tokensAnthropic-style token counting. Only Anthropic-backed targets are supported.
POST/v1/embeddingsVector embeddings. OpenAI-family adapter support only.
POST/v1/responsesOpenAI Responses API. Requires the resolved model to have provider: "openai".
POST/v1/images/generationsImage generation. Requires the resolved model to have provider: "openai".
POST/v1/audio/transcriptionsSpeech-to-text transcription. Forwards to upstream OpenAI-style audio routes.
POST/v1/audio/translationsSpeech translation. Forwards to upstream OpenAI-style audio routes.
POST/v1/audio/speechText-to-speech. Forwards to upstream OpenAI-style audio routes.
POST/v1/rerankReranking. Supports openai, cohere, and jina provider labels only.
ANY/passthrough/:provider/*restProvider-native forwarding with gateway authentication and limited gateway normalization.
GET/livezUnauthenticated liveness probe. Confirms the proxy listener is up.

Authentication

Proxy requests use caller-facing API keys created through the Admin API or AISIX Cloud.

Preferred form:

Authorization: Bearer <plaintext-caller-key>

Fallback form:

x-api-key: <plaintext-caller-key>

The caller API key is an AISIX gateway credential. It is not an upstream provider key.

Model Discovery

GET /v1/models returns the model aliases the caller API key is allowed to access. It does not expose multi-target aliases because they are routing constructs, not caller-facing models.

Routing Behavior

Multi-target aliases resolve to one or more target models at request time. They apply to /v1/chat/completions, /v1/messages, /v1/messages/count_tokens, and /v1/responses.

Streaming requests use the first selected eligible target and do not fail over mid-stream. Non-streaming requests can fail over to the next eligible target on retryable upstream failures.

/v1/responses can resolve a multi-target alias, but it only uses OpenAI-backed targets. If no OpenAI target is available, the gateway rejects the request.

/v1/messages/count_tokens can resolve a multi-target alias, but it only uses Anthropic-backed targets. If no Anthropic target is available, the gateway rejects the request.

Endpoint Constraints

Some routes impose provider-specific gates beyond adapter-family compatibility.

RouteGate
/v1/responsesRequires provider: "openai" on the resolved model.
/v1/images/generationsRequires provider: "openai" on the resolved model.
/v1/rerankRequires the model's provider label to be openai, cohere, or jina.
/v1/embeddingsReturns 501 not_implemented when the resolved adapter does not support embeddings.
/v1/audio/*Forwards OpenAI-style audio requests. Does not translate across provider families.

Passthrough

ANY /passthrough/:provider/*rest forwards provider-native requests after gateway authentication and provider resolution. The upstream provider's status code and response body are returned unchanged. This route intentionally applies less gateway normalization than first-class modeled routes.

Headers and Errors

Proxy responses can include AISIX-specific headers for request correlation, routing, cache status, rate-limit state, and retry timing. Error envelopes depend on the request format: OpenAI-compatible routes use an OpenAI-style error envelope, Anthropic-style routes use an Anthropic-style envelope, and passthrough routes return the upstream provider response.

For the complete header list, error envelopes, and status-code guidance, see Headers and Error Codes. For endpoint-by-endpoint provider support, see Provider Compatibility.

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation