Documentation

Everything you need to integrate EmbedRoute into your application.

Quickstart

EmbedRoute is OpenAI SDK compatible. If you're already using OpenAI embeddings, integration takes two lines of code.

JavaScript / TypeScript
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: 'er_your_api_key',        // Your EmbedRoute API key
  baseURL: 'https://api.embedroute.com/v1'  // EmbedRoute endpoint
})

const response = await client.embeddings.create({
  model: 'openai/text-embedding-3-small',
  input: 'Your text to embed'
})

console.log(response.data[0].embedding)
Python
from openai import OpenAI

client = OpenAI(
    api_key="er_your_api_key",
    base_url="https://api.embedroute.com/v1"
)

response = client.embeddings.create(
    model="openai/text-embedding-3-small",
    input="Your text to embed"
)

print(response.data[0].embedding)

Authentication

All API requests require an API key. Include your key in the Authorization header.

HTTP Header
Authorization: Bearer er_your_api_key

Tip: Your API key starts with er_. Keep it secret and never expose it in client-side code.

Create Embeddings

Generate embeddings for text input. The response format matches the OpenAI API.

Endpoint

POSThttps://api.embedroute.com/v1/embeddings

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g., openai/text-embedding-3-small)
inputstring | arrayYesText to embed. Can be a string or array of strings.
dimensionsintegerNoOutput dimensions (only supported by some models)

Example Request

cURL
curl https://api.embedroute.com/v1/embeddings \
  -H "Authorization: Bearer er_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/text-embedding-3-small",
    "input": "The quick brown fox jumps over the lazy dog"
  }'

Example Response

JSON
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0023, -0.0142, 0.0841, ...]
    }
  ],
  "model": "openai/text-embedding-3-small",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}

Supported Models

Use the provider/model format when specifying a model.

ProviderModel IDDimensionsMax Tokens
OpenAIopenai/text-embedding-3-small1,5368,191
OpenAIopenai/text-embedding-3-large3,0728,191
OpenAIopenai/text-embedding-ada-0021,5368,191
Voyagevoyage/voyage-31,02432,000
Voyagevoyage/voyage-3-lite51232,000
Voyagevoyage/voyage-code-31,02432,000
Coherecohere/embed-english-v3.01,024512
Coherecohere/embed-multilingual-v3.01,024512
Mistralmistral/mistral-embed1,0248,192

Error Handling

EmbedRoute returns standard HTTP status codes and JSON error responses.

StatusDescription
200Success
400Bad request – invalid parameters
401Unauthorized – invalid or missing API key
402Payment required – insufficient credits
429Rate limit exceeded
500Server error

Error Response Format

{
  "error": {
    "message": "Invalid API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}

Rate Limits

Rate limits depend on your plan. Headers indicate your current usage.

HeaderDescription
X-RateLimit-LimitRequests allowed per minute
X-RateLimit-RemainingRequests remaining this minute
X-RateLimit-ResetUnix timestamp when limits reset

Need higher limits? Contact us at support@embedroute.com for enterprise plans with custom rate limits.

Ready to get started?

Join the waitlist to get your API key.

Join the Waitlist