Embeddings
Create vector representations of text for semantic search, clustering, and retrieval. The endpoint uses the OpenAI request and response shapes.
Overview
Send an Inferada model ID or alias in model. The gateway resolves it to the upstream configured for your organisation's embeddings service. Discover the models available to your token with /v1/models?scope=embeddings.
This endpoint requires the embeddings scope and records input-token usage; it does not generate output tokens. For retrieval systems, use vector search to find candidates and Rerank to refine their order by relevance. Both endpoints use the same scope and model catalogue.
Create embeddings
/v1/embeddingsGenerate one embedding vector per input. Pass a single string or an array of strings.
Request
modelrequiredstring- Embedding model id or alias. Discover options with GET /v1/models?scope=embeddings.
inputrequiredstring | string[]- Text to embed. A single string returns one vector; an array returns one vector per element, in order.
encoding_formatstring- "float" (default) returns each vector as a JSON array of numbers; "base64" returns it as a base64-encoded little-endian float32 string.
dimensionsinteger- Truncate vectors to this many dimensions (supported by OpenAI-compatible upstreams; ignored by providers that don't support it).
userstring- Optional end-user identifier forwarded to OpenAI-compatible upstreams.
service_idstring- Optional. Route to a specific embeddings service (see GET /v1/services). Falls back to the org's default embeddings service when omitted.
curl https://api.inferada.com/v1/embeddings \
-H "Authorization: Bearer inf_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": "The quick brown fox"
}'Pass an array to embed multiple strings in one request. Use each result's index to map it back to the input:
{
"model": "text-embedding-3-small",
"input": ["first document", "second document"]
}Response · 200
objectstring- Always "list".
data[].embeddingnumber[] | string- The vector: a number array, or a base64 string when encoding_format is "base64".
data[].indexnumber- Position of this vector's input in the request.
usage.prompt_tokensnumber- Input tokens consumed (equals total_tokens for embeddings).
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0091, 0.0145, "..."]
}
],
"model": "text-embedding-3-small",
"usage": { "prompt_tokens": 8, "total_tokens": 8 }
}Errors
A 400 response means input is empty or invalid, or the resolved upstream does not support embeddings. A 404 response means the model is unknown or unavailable to your token.