Перейти к содержанию

Превратите текст в векторы

Кодируйте текст в 1024-мерные векторы для семантического поиска, кластеризации и генерации с извлечением данных.

Как это работает

  1. 01

    Укажите базовый URL клиента: https://my.neuronai.uz/api/v1.

  2. 02

    Отправьте строку или список строк в поле input на POST /embeddings.

  3. 03

    Сохраните каждый вектор вместе с его текстом. Каждый результат содержит index своего входа.

Аутентификация

Передавайте ключ как Authorization: Bearer, OpenAI SDK делает это за вас. Для эмбеддингов нужно право embeddings:write.

Пример

Клиент и ключ, которые вызывают chat completions, работают и здесь, а ответ сохраняет формат OpenAI. Оплата идёт за токены, о которых сообщает модель.

cURL
curl -X POST "https://my.neuronai.uz/api/v1/embeddings" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "model": "bge-m3",
    "input": "Toshkent bugun qanday?"
  }'

Справочник API

Поля запросов, ответы, цены и примеры кода для каждого эндпоинта, а также форма, которая отправляет настоящий запрос.

Хранится только в вашем браузере.

Embeddings

Vector embeddings for semantic search and RAG. OpenAI-compatible — point your OpenAI SDK at this base URL.

POST
/v1/embeddings

Bearer

Create embeddings

Returns a 1024-dimensional dense vector per input. OpenAI-compatible — set your OpenAI SDK's base URL to `{app}/api/v1` and use your API key. Billed per input token.

Pricing
per 1K tokens
Input
0.1 credits
Тело запроса
application/json
ПолеОписание
modelОбязательноstring

maxLen: 128

encoding_formatstring | null

Only float vectors are served; base64 is an OpenAI option we do not support.

Допустимые значения: "float"null

inputОбязательноobject

The text to embed: one string, or a list of strings for a batch.

Ответы
200
One embedding per input, in the order of `input`: `index` is the position of its input, from 0. Each `embedding` is a list of floats, the only `encoding_format` served. `usage` gives the tokens the model counted; `prompt_tokens` is what is billed.
application/json
ЗаголовокОписание
X-CostnumberThe price billed, in credits.
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
objectОбязательноstring
modelОбязательноstring
dataОбязательноobject[]
usageОбязательноobject
401
The API key is missing or not recognized (`invalid_api_key`), revoked (`api_key_revoked`), disabled (`api_key_disabled`) or expired (`api_key_expired`).
application/json
ЗаголовокX-Request-Id: string
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

402
Not enough balance for the estimated cost (`insufficient_balance`), or that cost would pass this key's monthly spend limit (`spend_limit_exceeded`). Nothing is charged.
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

403
The key lacks the permission this endpoint needs (`insufficient_permissions`), or the client IP is not in its allowlist (`ip_not_allowed`).
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

404
`model` is not an embedding model this API serves: `model_not_found`.
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

422
The request failed validation (`invalid_request`: `error.param` names the first invalid field and `error.fields` maps each one to its message), the batch has more inputs than allowed (`batch_too_large`), an input is over the tokens the model takes (`input_too_large`), or the model refused the input (`upstream_rejected_input`), which fails again unchanged. Nothing is charged.
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

429
The embedding model is at capacity: `upstream_rate_limited`. Nothing is charged. Too many requests: the per-minute rate limit is used up (`rate_limit_exceeded`), or this key or its organization already has as many requests in flight as it may (`concurrency_limit_exceeded`). Wait `Retry-After` seconds, then retry.
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
Retry-AfterintegerSeconds to wait before retrying.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
X-RateLimit-ResetintegerWhen the rate limit lets requests through again, as a Unix time in seconds. Sent with a 429 for `rate_limit_exceeded`.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

502
The embedding model failed or could not be reached: `upstream_error`. Nothing is charged.
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

default
Any other error, in the same envelope. For example `server_error` (500) when something fails unexpectedly, `service_unavailable` (503) while the API is down for maintenance, or `input_too_large` (413) when the request body is larger than the server accepts.
application/json
ЗаголовокОписание
X-Request-IdstringIdentifies this request. A JSON body carries it as `request_id` too; quote it to support.
Retry-AfterintegerSeconds to wait before retrying. Sent with a 503 during maintenance, when a retry time was set.
X-RateLimit-LimitintegerThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerHow many of them are left this minute.
ПолеОписание
errorОбязательноobject
request_idОбязательноstring

The same ID as the `X-Request-Id` header.

format: uuid

Примеры
cURL
curl -X POST "https://my.neuronai.uz/api/v1/embeddings" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "model": "bge-m3",
    "input": "Toshkent bugun qanday?"
  }'

Попробовать

Укажите API-ключ в панели выше, чтобы отправлять запросы с ключом.

application/json