POST /v1/embeddings
Embeddings generation endpoint.
Inference APIs
Generate embeddings through a configured provider and return the upstream list shape with gateway headers.
POST/v1/embeddings
Request
- Auth: tenant auth when enabled; otherwise dev mode is open
- Content-Type:
application/json - Max body size: 4 MiB
Request fields
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | Alias or direct provider string |
input | any JSON | yes | String, array of strings, or token array depending on upstream provider |
encoding_format | string | no | Passed upstream when present |
dimensions | integer | no | Passed upstream when present |
user | string | no | Passed upstream when present |
metadata or aramm | object | no | Attribution fields stripped before upstream dispatch |
Response schema
| Field | Type | Required | Notes |
|---|---|---|---|
object | string | yes | Always list |
model | string | yes | Public alias used for the request |
data | array | yes | Embedding vectors in index order |
data[].index | integer | yes | Input index |
data[].object | string | yes | Always embedding |
data[].embedding | number[] | yes | Embedding vector |
usage | object | no | Token usage when returned by the upstream provider |
usage.prompt_tokens | integer | no | Prompt token count |
usage.total_tokens | integer | no | Total token count |
Errors
| HTTP | Code | When |
|---|---|---|
400 | invalid_request_error | Malformed JSON or missing required fields |
400 | provider_not_configured | Provider missing from config or unavailable |
400 | invalid_request_error | Provider does not support embeddings |
502 | provider-specific | Upstream provider error normalized to the gateway envelope |
Notes
- The gateway returns the upstream JSON shape.
- Unsupported providers return normalized errors.
- Response headers include model, provider, latency, and billing metadata when available.