Embeddings
Creates vector embeddings for text input. Supports models from OpenAI, Google, and DeepInfra. Compatible with OpenAI SDK.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
The fully qualified model slug. Choose from supported models (openai/text-embedding-3-small, openai/text-embedding-3-large, openai/text-embedding-ada-002, google/gemini-embedding-001, deepinfra/intfloat-e5-base-v2)
openai/text-embedding-3-largePossible values: The input text or list of text items to embed. Can be a single string or array of strings for batch processing.
Single text string to embed
Array of text strings to embed (batch processing)
Optional: Requested embedding size/dimensions. Supported only in text-embedding-3 series and newer models. Allows you to reduce embedding size for efficiency.
256Format for the embedding vector. 'float' returns array of numbers, 'base64' returns base64-encoded string.
floatPossible values: Optional: A unique identifier representing your end-user, for monitoring and abuse detection.
Embeddings created successfully
Object type, always 'list'
listModel used for embedding generation
openai/text-embedding-3-largeBad Request - Invalid parameters or model
Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.
Note: the 401 error body uses code, message, param, and type (there is no status field), and type is invalid_request_error.
Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.
Internal Server Error
POST /api/v1/embeddings HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 78
{
"model": "openai/text-embedding-3-large",
"input": "Your text string goes here"
}{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023,
0.0492,
-0.0123,
-0.0187
]
}
],
"model": "openai/text-embedding-3-large",
"usage": {
"prompt_tokens": 5,
"total_tokens": 5
}
}Last updated
