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..."
}'
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)
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292
]
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
Embeddings
Convert text into vector embeddings. Supports single or batch text input, with optional output dimensions and encoding format.
POST
/
v1
/
embeddings
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..."
}'
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)
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292
]
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
Headers
string
required
Bearer token authentication. Format:
Authorization: Bearer sk-xxxxxxBody
Format:application/json
string
required
Model ID
string | string[]
required
Text to embed
string
default:"float"
Encoding format, allowed values:
float, base64integer
Output vector dimensions
Response
200 Success
Format:application/json
string
Always
listobject[]
string
Model ID used
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..."
}'
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)
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0023064255,
-0.009327292
]
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
Last modified on October 28, 2026
Was this page helpful?