POST /v1/embeddings
Converts input into a high-dimensional vector representation (embedding). Embeddings are used for semantic search, clustering, classification, and retrieval-augmented generation (RAG). The gateway supports text, image, and video embedding inputs depending on the provider. The response always includes adata array with embedding vectors indexed to match the input.
Request headers
The provider to route the request to (e.g.
openai, cohere, google-vertex-ai). Required when not using a config.Your provider API key.
A JSON config object or config ID that defines routing, fallbacks, retries, and more.
A virtual key ID from Portkey Cloud.
Request body
The embedding model to use (e.g.
text-embedding-3-small, embed-english-v3.0).The text or texts to embed. Accepts:
- A single string
- An array of strings for batch embedding
- An array of
EmbedInputobjects withtext,image, orvideofields for multimodal providers
The format of the returned embeddings. One of
float or base64.The number of dimensions in the output embedding. Only supported by models that accept a
dimensions parameter (e.g. text-embedding-3-small).A unique identifier for the end user, used for monitoring.
Response
Always
list.An array of embedding objects, one per input item, in the same order as the input.
The model used to generate the embeddings.
Token usage for this request.