AI Gateway Universal API
Zuplo AI Gateway provides a universal API that standardizes interactions with various AI providers. This API follows the OpenAI API specification, making it easy to integrate with existing apps that already use OpenAI's API.
Using the Universal API
Every AI Gateway app serves the Universal API. The app page in the portal shows
each app's API URL, which ends in the app's ID—for example
https://my-gateway-main-2e18f50.zuplo.app/config_fe0a04972d2848e0a94ae4b8bcd1497e.
Client libraries expect a base URL ending in /v1, so append that suffix. When
the gateway runs the
authentication policy, send the app's API
key as a bearer token.
Models are referenced as providerName/model, where providerName is the
provider name configured in your gateway. This is how the gateway knows which
provider to route each request to—and it means one app can use models from
several providers through the same endpoint.
If you are using an SDK or library that supports custom base URLs, you can
configure it to use your app's URL. For example, with the OpenAI Node.js SDK,
you can set the baseURL option:
Code
If the app's
Model Filtering policy
has an allow list, a request that omits model uses the first model in the
list—so clients that can't set a model still work.
Supported endpoints
| Endpoint | Notes |
|---|---|
/v1/chat/completions | Chat completions for every provider |
/v1/embeddings | Embeddings for every provider except Anthropic |
/v1/responses | OpenAI Responses API, for OpenAI-backed providers |
/v1/messages | Anthropic Messages API, for Anthropic-backed providers |