Skip to main content
POST
/
v2
/
router
/
embeddings
Create embeddings
curl --request POST \
  --url https://api.orq.ai/v2/router/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "<string>",
  "model": "<string>",
  "encoding_format": "float",
  "dimensions": 123,
  "user": "<string>",
  "name": "<string>",
  "fallbacks": [
    {
      "model": "openai/text-embedding-3-small"
    }
  ],
  "retry": {
    "count": 3,
    "on_codes": [
      429,
      500,
      502,
      503,
      504
    ]
  },
  "cache": {
    "type": "exact_match",
    "ttl": 3600
  },
  "load_balancer": {
    "type": "weight_based",
    "models": [
      {
        "model": "openai/gpt-4o",
        "weight": 0.7
      }
    ]
  },
  "timeout": {
    "call_timeout": 30000
  },
  "orq": {
    "name": "<string>",
    "fallbacks": [
      {
        "model": "openai/gpt-4o-mini"
      }
    ],
    "cache": {
      "type": "exact_match",
      "ttl": 3600
    },
    "retry": {
      "count": 3,
      "on_codes": [
        429,
        500,
        502,
        503,
        504
      ]
    },
    "identity": {
      "id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      "display_name": "Jane Doe",
      "email": "jane.doe@example.com",
      "metadata": [
        {
          "department": "Engineering",
          "role": "Senior Developer"
        }
      ],
      "logo_url": "https://example.com/avatars/jane-doe.jpg",
      "tags": [
        "hr",
        "engineering"
      ]
    },
    "contact": {
      "id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      "display_name": "Jane Doe",
      "email": "jane.doe@example.com",
      "metadata": [
        {
          "department": "Engineering",
          "role": "Senior Developer"
        }
      ],
      "logo_url": "https://example.com/avatars/jane-doe.jpg",
      "tags": [
        "hr",
        "engineering"
      ]
    },
    "load_balancer": {
      "type": "weight_based",
      "models": [
        {
          "model": "openai/gpt-4o",
          "weight": 0.7
        },
        {
          "model": "anthropic/claude-3-5-sonnet",
          "weight": 0.3
        }
      ]
    },
    "timeout": {
      "call_timeout": 30000
    }
  }
}
'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        123
      ],
      "index": 123
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

input

input
required

Input text to embed, encoded as a string or array of tokens.

Minimum string length: 1
model
string
required

ID of the model to use

encoding_format
enum<string>
default:float

Type of the document element

Available options:
base64,
float
dimensions
number

The number of dimensions the resulting output embeddings should have.

user
string

A unique identifier representing your end-user

name
string

The name to display on the trace. If not specified, the default system name will be used.

fallbacks
object[]

Array of fallback models to use if primary model fails

retry
object

Retry configuration for the request

cache
object

Cache configuration for the request.

load_balancer
object

Load balancer configuration for the request.

timeout
object

Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.

orq
object

Response

200 - application/json

Returns the embedding vector.

object
enum<string>
required
Available options:
list
data
object[]
required
model
string
required

ID of the model to used.

usage
object
required

The usage information for the request.