Embeddings API

FastRouter.ai supports a unified Embeddings API to generate high-quality vector representations for your text using supported model providers like OpenAI.

Supported Models

Model Slug
Description

openai/text-embedding-3-small

Fast and lightweight embedding model

openai/text-embedding-3-large

High-quality embeddings for nuanced tasks

openai/text-embedding-ada-002

Most cost-effective embedding model

Parameters

Field
Type
Description

model

string

The fully qualified model slug. See Supported Models above.

input

string or string[]

The input text or array of texts to embed. Maximum length depends on the model used.

dimensions

integer

Optional. The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

Endpoint

POST https://go.fastrouter.ai/v1/embeddings

Request Format

Send a prompt input with an optional dimensions parameter to generate embeddings.

Request Example

{
  "model": "openai/text-embedding-3-large",
  "input": "What is node JS?",
  "dimensions": 4  
}

Sample Response

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0023, 0.0492, ..., -0.0187]
    }
  ],
  "model": "openai/text-embedding-3-large",
  "usage": {
    "prompt_tokens": 5,
    "total_tokens": 5
  }
}

Last updated