> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nodesms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Embeddings

> Convert text into vector embeddings. Supports single or batch text input, with optional output dimensions and encoding format.

## Headers

**Authorization** `string` *required*

Bearer token authentication. Format: `Authorization: Bearer sk-xxxxxx`

## Body

Format: `application/json`

**model** `string` *required*

Model ID

**input** `string | string[]` *required*

Text to embed

**encoding\_format** `string` (default: float)

Encoding format, allowed values: `float`, `base64`

**dimensions** `integer`

Output vector dimensions

## Response

### 200 Success

Format: `application/json`

**object** `string`

Always `list`

**data** `object[]`

List of embedding vectors

**Properties**

**object** `string`

Always `embedding`

**index** `integer`

Index

**embedding** `array`

Array of vector values

**model** `string`

Model ID used

**usage** `object`

Token usage statistics

**Properties**

**prompt\_tokens** `integer`

Input token count

**total\_tokens** `integer`

Total token count

```bash cURL theme={"dark"}
curl -X POST "https://t.ato2.nodesms.com/v1/embeddings" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-ada-002",
    "input": "The food was delicious and the waiter..."
  }'
```

```python Python theme={"dark"}
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxxx",
    base_url="https://t.ato2.nodesms.com/v1"
)

response = client.embeddings.create(
    model="text-embedding-ada-002",
    input="The food was delicious and the waiter..."
)
print(response.data[0].embedding)
```

```json 200 theme={"dark"}
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292
      ]
    }
  ],
  "model": "text-embedding-ada-002",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.