Native OpenAI format
curl --request POST \
--url https://api.gravitex.ai/v1/embeddings \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {},
"encoding_format": "<string>",
"dimensions": 123
}
'Completions & Embeddings
Embeddings (OpenAI format)
POST /v1/embeddings text embeddings
POST
/
v1
/
embeddings
Native OpenAI format
curl --request POST \
--url https://api.gravitex.ai/v1/embeddings \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {},
"encoding_format": "<string>",
"dimensions": 123
}
'Documentation Index
Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Convert text to vector embeddings for semantic search, similarity, and clustering. Compatible with the OpenAI Embeddings API.Authentication
Bearer Token, e.g.
Bearer sk-xxxxxxxxxxRequest body
Model name, e.g.
text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002Text to embed (string or array of strings)
float or base64Output dimensions (some models only)
Example
curl https://api.gravitex.ai/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-d '{
"model": "text-embedding-3-small",
"input": "Hello, world"
}'
Python example
from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxxxxxx",
base_url="https://api.gravitex.ai/v1"
)
response = client.embeddings.create(
model="text-embedding-3-small",
input="Hello, world"
)
print(response.data[0].embedding)
Supported models
| Model | Dimensions | Notes |
|---|---|---|
| text-embedding-3-small | 1536 | Cost-effective |
| text-embedding-3-large | 3072 | High precision |
| text-embedding-ada-002 | 1536 | Legacy |
- Pass an array to
inputfor batch embedding - Some models support custom
dimensions
⌘I