For the complete documentation index, see llms.txt. This page is also available as Markdown.

Embeddings

Create Embedding

post

OpenAI-compatible embeddings endpoint.

Authentication modes:

  • Master key + user field: Use specified user (must exist)

  • API key + user field: Use specified user (must exist)

  • API key without user field: Use the shared "default" user

A priced response carries its cost on usage as cost_usd (a six-decimal USD string) and pricing_source, as a chat completion does; an unpriced one carries neither.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

OpenAI-compatible embedding request.

dimensionsinteger · nullableOptional
encoding_formatstring · nullableOptional
inputany ofRequired

Input text to embed

stringOptional
or
string[]Optional
input_typestring · max: 64 · nullableOptional

What the input will be used for, for providers whose embedding depends on it: Cohere (search_document, search_query, classification, clustering, image) and Voyage (query, document). The provider validates the value. Any other provider answers 400, rather than embedding the input as if the field were absent.

modelstringRequired
userstring · nullableOptional
Responses
200

Successful Response

application/json

An OpenAI-compatible embeddings response, with the gateway's inline cost on usage.

modelstringRequired
objectconst: listOptionalDefault: list
post/api/v1/embeddings
POST /api/v1/embeddings HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 105

{
  "dimensions": 1,
  "encoding_format": "text",
  "input": "text",
  "input_type": "text",
  "model": "text",
  "user": "text"
}
{
  "data": [
    {
      "embedding": [
        1
      ],
      "index": 1,
      "object": "embedding"
    }
  ],
  "model": "text",
  "object": "list",
  "usage": {
    "cost_usd": "text",
    "pricing_source": "text",
    "prompt_tokens": 1,
    "total_tokens": 1
  }
}

Last updated

Was this helpful?