Skip to main content
POST
/
v1
/
embeddings
Create embedding
curl --request POST \
  --url https://api.siray.ai/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dimensions": 1,
  "encoding_format": "float",
  "input": null,
  "model": "google/gemini-embedding-001"
}
'
{
  "data": [
    {
      "embedding": [
        123
      ],
      "index": 123,
      "object": "embedding"
    }
  ],
  "model": "<string>",
  "object": "list",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123,
    "completion_tokens": 123,
    "completion_tokens_details": {
      "audio_tokens": 123,
      "reasoning_tokens": 123,
      "text_tokens": 123
    },
    "input_tokens": 123,
    "input_tokens_details": {
      "audio_tokens": 123,
      "cached_tokens": 123,
      "image_tokens": 123,
      "text_tokens": 123
    },
    "output_tokens": 123,
    "prompt_tokens_details": {
      "audio_tokens": 123,
      "cached_tokens": 123,
      "image_tokens": 123,
      "text_tokens": 123
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication using API key

Body

application/json

Request payload

OpenAI-compatible embeddings API request format

input
required

The input text to embed, either a string or array of strings

model
enum<string>
required

Model name to use for the request

Available options:
google/gemini-embedding-001
dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported in some models.

Required range: x >= 1
encoding_format
enum<string>
default:float

The format to return the embeddings in

Available options:
float,
base64

Response

200 - application/json

Successful response

Embeddings API response

data
object[]
required

List of embedding objects

model
string
required

The model used for embeddings

object
enum<string>
required

Object type, always 'list'

Available options:
list
usage
object
required

Usage information for the embeddings request