Overview
The proxy embeddings endpoint provides OpenAI-compatible embedding generation with authentication, rate limiting, and cost tracking.Endpoint
POST /embeddingsPOST /engines/{model}/embeddingsPOST /openai/deployments/{model}/embeddings
Authentication
string
required
Bearer token for authentication.
Request Headers
string
default:"application/json"
Content type of the request body.
string
End-user ID for tracking.
string
JSON stringified metadata.
Request Body
string
required
Embedding model to use.Examples:
text-embedding-3-small, text-embedding-ada-002string | array
required
Text to embed. Can be a single string or array of strings.Or:
string
default:"float"
Format of the embeddings.Options:
"float", "base64"integer
Number of dimensions for the embedding (text-embedding-3 models only).
string
Unique identifier for end-user.
Response
Success Response (200)
string
Object type, always “list”.
array
Array of embedding objects.
string
Model used for embeddings.
object
Token usage information.
Examples
Basic Request
Python Request
Batch Embeddings
With User Tracking
Custom Dimensions
Error Responses
401 Unauthorized
429 Too Many Requests
400 Bad Request
Proxy Features
Cost Tracking
The proxy automatically tracks embedding costs:- Per-key spending
- Per-team spending
- Per-user spending
Rate Limiting
Keys can have TPM limits for embeddings:- Requests throttled automatically
- 429 error when limit exceeded
Model Routing
Proxy can route to different embedding providers:- OpenAI
- Azure OpenAI
- Cohere
- Bedrock
- Vertex AI
- And more!