Documentation

A free, OpenAI-compatible embeddings endpoint. Bring your own provider key — EmbedRoute routes the request and adds no markup.

Quickstart

Send your text and your provider key to one endpoint. The response matches OpenAI’s embeddings format.

cURL
curl https://www.embedroute.com/api/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "X-Provider-Key: $OPENAI_API_KEY" \
  -d '{
    "model": "openai/text-embedding-3-small",
    "input": "The quick brown fox jumps over the lazy dog"
  }'
JavaScript — OpenAI SDK (drop-in)
import OpenAI from 'openai'

// True drop-in: just point baseURL at EmbedRoute and use YOUR provider key.
const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,   // your provider key (must match the model)
  baseURL: 'https://www.embedroute.com/api/v1',
})

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

console.log(res.data[0].embedding)
Python — OpenAI SDK (drop-in)
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["VOYAGE_API_KEY"],   # your provider key (Voyage here)
    base_url="https://www.embedroute.com/api/v1",
)

res = client.embeddings.create(
    model="voyage/voyage-4",                 # switch providers by changing this
    input="Your text to embed",
)

print(res.data[0].embedding)

Bring your own key

EmbedRoute is bring-your-own-key: you pass the API key for the target provider on every request, and we use it only to make that one call — never storing it. There are two ways to send it:

  • OpenAI-SDK drop-in: put your provider key in the SDK’s apiKey (it becomes the Authorization header). Nothing else needed.
  • Explicit header: send X-Provider-Key: <your key>. Use this when you also want to send an EmbedRoute er_ key in Authorization for usage tracking.
HTTP headers
# Drop-in: provider key as the bearer
Authorization: Bearer <your provider key>

# Or, explicit — plus an optional EmbedRoute key for usage history:
X-Provider-Key: <your provider key>
Authorization: Bearer er_your_embedroute_key

The key must match the model’s provider. A voyage/… model needs a Voyage key, a cohere/… model a Cohere key, and so on. Keep provider keys out of client-side code in production.

Create embeddings

POST https://www.embedroute.com/api/v1/embeddings

Request body

ParameterTypeRequiredDescription
modelstringYesprovider/model, e.g. voyage/voyage-4
inputstring | string[]YesText to embed, or an array of texts.

Example response

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

Supported models

Use the provider/model format. Prices are the provider’s own list price per 1M input tokens; you pay them directly. The live catalog is also available at GET https://www.embedroute.com/api/v1/models.

Model IDDimensionsMax tokens$ / 1M
openai/text-embedding-3-small1,5368,191$0.02
openai/text-embedding-3-large3,0728,191$0.13
voyage/voyage-4-lite1,02432,000$0.02
voyage/voyage-41,02432,000$0.06
voyage/voyage-4-large1,02432,000$0.12
voyage/voyage-code-31,02432,000$0.18
cohere/embed-v4.01,536128,000$0.12
mistral/mistral-embed1,0248,192$0.1
mistral/codestral-embed-25051,5368,192$0.15
google/gemini-embedding-0013,0722,048$0.15

Error handling

Standard HTTP status codes with a JSON error body.

StatusMeaning
200Success
400Bad request — missing model/input, unknown model, or missing X-Provider-Key
401Invalid EmbedRoute (er_) key, when one is supplied
422The provider rejected your provider key (bad or unauthorized key)
429Rate limited
502The upstream provider was unreachable or errored
503EmbedRoute auth service temporarily unavailable (retry)
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "provider_error",
    "provider_status": 401
  }
}

Accounts & usage

You don’t need an account to use the router or the Lab. A free account gives you an EmbedRoute key (er_…) that you can pass in the Authorization header to record usage history in your dashboard. It never replaces your provider key — you still bring that.

Rate limits. Anonymous requests are limited per IP; requests made with an EmbedRoute key get a higher per-account limit. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset; a 429 also returns Retry-After.

Ready to compare models?

Open the Lab and run your own data through several models.

Open the Lab