OpenAI
Text Embedding 3 Small
OpenAI low-cost text embedding model that converts text into vectors for bulk text processing, semantic search, and knowledge retrieval
Model TypeText Embedding Model
Input / OutputText input, vector output
API EndpointPOST /v1/embeddings
Pricing & Specs
💰 Pricing
Input$0.02 / M tokens
Output$0 / M tokens
⚙️ Specs
Model TypeText Embedding Model
Input / OutputText input, vector output
API EndpointPOST /v1/embeddings
BillingBilled by input tokens; no output charge
API Examples
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.xairouter.com/v1"
)
response = client.embeddings.create(
model="text-embedding-3-small",
input="XAI Router provides a unified API for AI models."
)
print(response.data[0].embedding)cURL (OpenAI API)
curl https://api.xairouter.com/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "text-embedding-3-small",
"input": "XAI Router provides a unified API for AI models."
}'