Embeddings (unified compat endpoint)¶
Note
The endpoint requires a gateway token in the Authorization: Bearer <token> header while auth_required: true is set on the gateway. That is the default.
Send the request as POST to the path /v1/{tenant}/{gateway}/compat/embeddings.
Description¶
Generate embeddings via the gateway's provider-agnostic endpoint.
Request¶
The following parameters are available:
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
tenant |
path | string |
yes | Tenant slug (from the tenant's slug field). |
gateway |
path | string |
yes | Gateway slug (from the gateway's slug field). |
x-aig-byok-alias |
header | string |
no | Selects which stored BYOK key to use for this request. Defaults to default. Use when you have stored multiple keys for the same provider under different aliases. |
x-aig-collect-log-payload |
header | string |
no | Set to false to suppress storing the request and response body text in the log for this specific request. Useful for requests containing sensitive data that should not be logged even when log_payloads: true is configured on the gateway. |
Example¶
Example of the request body:
Responses¶
The endpoint answers the request with the following status codes:
| Status code | Description |
|---|---|
200 |
Embedding response. |
400 |
Invalid request body or missing required field. |
401 |
Missing or invalid auth token. |
424 |
provider_key_missing — the selected model routes to a provider that requires an API key, but no key is stored for this gateway (and alias). An admin must add a provider key. Returned before any upstream call. |
429 |
Rate limit or budget quota exceeded. |
502 |
All upstream providers failed (retries and fallbacks exhausted). |