---
title: "Turn text into vectors"
method: POST
path: "/v1/embeddings"
tags: ["Embeddings"]
---

# Turn text into vectors

`POST /v1/embeddings`

## Request

- Base URL: `https://inference.openrelay.inc`
- URL: `https://inference.openrelay.inc/v1/embeddings`
- Auth: HTTP bearer

Turns text into vectors for search, retrieval, clustering and deduplication in the OpenAI embeddings shape, served by openrelay/bge-m3 today.
openrelay/bge-m3 is multilingual and returns 1024-dimension dense vectors; check a model's supported_apis on GET /v1/models for embeddings.

Requires a funded balance. No output rate: billed only on usage.prompt_tokens. stream is dropped. Limits: 8192 tokens per input item, 1024 items per request, 10 MiB request body. Also runs through the Batch API at endpoint /v1/embeddings, at the batch rate.

Requires the `inference.invoke` permission. See [Permissions](https://docs.openrelay.inc/docs/permissions) for the roles and API key permissions that include it.

## Request body

- EmbeddingRequest: An OpenAI-compatible embeddings request. stream is dropped; a response is always a single JSON body.
  - `input` union, required: The text to embed. An array embeds each item independently and returns one vector per item, in order.
    - string
    - string[]
  - `model` string, required: An OpenRelay public model id, e.g. openrelay/bge-m3.

## Response `200`

OK

- EmbeddingResponse: An OpenAI embeddings list object (opaque; additionalProperties carries the rest of the dialect).
  - `data` object[]
  - `model` string
  - `object` 'list'
  - `openrelay` OpenRelayResponseMeta: What the request is billed, on every online inference response.
    - `cost_nano_usd` integer: What this call is billed, in nanoUSD. Also sent as the OpenRelay-Cost-Nano-USD header.
    - `priced_at` string: Pricing basis, e.g. online.
  - `usage` object

## Other responses

- `400`: The request is invalid
- `401`: Missing or invalid API key
- `402`: Refused for spend: the organization's balance is below the spend floor (insufficient_balance), or the API key's spend budget is used up (key_budget_exceeded)
- `403`: Refused, type permission_error. An inference call, a batch create or a file upload is refused while the account is unavailable, paused or under review (account_suspended, account_unavailable) or being verified (account_pending_verification), and an inference call names a model that takes an access request first (model_access_required). With permissions enabled, a role, key restriction, network rule or policy refuses the request (permission_denied, with permission and denied_by), or the model is outside the key's, role's or organization's model list (model_not_allowed, with permission, denied_by, model and allowed_models_hint); the OpenRelay-Required-Permission header names the permission.
- `413`: The upload exceeds the 200 MB limit
- `429`: Too many concurrent uploads; retry shortly
- `503`: The action could not be dispatched; retry

## Changes

- **2026-10-26** `7fe59d94a9f5`: 31 info
  - added the non-success response with the status `403`
  - added the optional property `error/allowed_models_hint` to the response with the `400` status
  - added the optional property `error/allowed_models_hint` to the response with the `401` status
  - added the optional property `error/allowed_models_hint` to the response with the `402` status
  - …27 more
- **2026-10-21** `dc9750cb25b5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openrelay/apis/openrelay-api/changes/v1/embeddings/post.md)

---

[API](https://skmtc.dev/openrelay/apis/openrelay-api.md) - [All operations](https://skmtc.dev/openrelay/apis/openrelay-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openrelay/apis/openrelay-api/revisions/7fe59d94a9f5?raw)
