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

Create embeddings

POSThttps://my.neuronai.uz/api/v1/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.

Нужен API-ключ с embeddings:write.

Стоимость
за 1000 токенов
Input
0,1 кредита

Тело запроса

application/json

JSON-объект.

  • modelstringОбязательно

    Макс. длина: 128

  • encoding_formatstring | nullНеобязательный

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

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

  • inputobjectОбязательно

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

Ответ

200application/json

One embedding per input, in the order of input. usage.prompt_tokens is what is billed.

  • objectstringОбязательно
  • modelstringОбязательно
  • dataobject[]Обязательно
  • usageobjectОбязательно

Заголовки

  • X-CostnumberНеобязательный

    The price billed, in credits.

  • X-Request-IdstringНеобязательный

    Identifies this request. A JSON body carries it as request_id too; quote it to support.

    Формат: uuid

  • X-RateLimit-LimitintegerНеобязательный

    The 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-RemainingintegerНеобязательный

    How many of them are left this minute.

Ошибки

  • 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).

  • 402

    Not enough balance (insufficient_balance), or over the key's monthly spend limit (spend_limit_exceeded). Nothing is charged.

  • 403

    The key lacks the permission this endpoint needs (insufficient_permissions), or the client IP is not in its allowlist (ip_not_allowed).

  • 404

    model is not an embedding model this API serves: model_not_found.

  • 422

    The request failed validation (invalid_request), it has too many inputs (batch_too_large), an input is too long (input_too_large), or the model refused an input (upstream_rejected_input). Nothing is charged.

  • 429

    The model is busy (upstream_rate_limited), or a rate or concurrency limit was reached (rate_limit_exceeded, concurrency_limit_exceeded). Retry after Retry-After seconds. Nothing is charged.

  • 502

    The embedding model failed or could not be reached: upstream_error. Nothing is charged.

  • default

    Any other error, in the same shape, such as server_error (500) or service_unavailable (503).