Documentation Index
Fetch the complete documentation index at: https://docs.crazyrouter.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Convert input text into high-dimensional vectors for use in semantic search, clustering, recommendations, and more. Fully compatible with the OpenAI Embeddings API format.
Supported Models
| Model | Dimensions | Description |
|---|
text-embedding-3-large | 3072 | High accuracy, recommended for production |
text-embedding-3-small | 1536 | Cost-effective |
text-embedding-ada-002 | 1536 | Classic model |
Request Parameters
Embedding model name, e.g. text-embedding-3-large
input
string | string[]
обязательно
Text to embed. Supports a single string or an array of strings
encoding_format
string
по умолчанию:"float"
Return format: float or base64
Output vector dimensions (only supported by text-embedding-3-* models)
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023064255, -0.009327292, ...]
}
],
"model": "text-embedding-3-large",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}
Code Examples
from openai import OpenAI
client = OpenAI(
api_key="sk-xxx",
base_url="https://crazyrouter.com/v1"
)
response = client.embeddings.create(
model="text-embedding-3-large",
input="Crazyrouter is an AI model gateway"
)
embedding = response.data[0].embedding
print(f"Vector dimensions: {len(embedding)}")
print(f"First 5 values: {embedding[:5]}")
Batch requests support up to 2048 texts per call. Each text should not exceed 8191 tokens.