Embeddings
Generate 1024-dimensional vector embeddings with zen-embedding
Embeddings
Generate dense vector embeddings for text using zen-embedding, the embedding
model in the Zen family.
Endpoint
POST https://api.hanzo.ai/v1/embeddingsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be zen-embedding |
input | string/array | Yes | Text to embed (string or array of strings) |
Example
curl https://api.hanzo.ai/v1/embeddings \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zen-embedding",
"input": "Zen LM is a family of frontier AI models"
}'Python
from hanzoai import Hanzo
client = Hanzo(api_key="hk-your-key")
response = client.embeddings.create(
model="zen-embedding",
input=["Hello world", "Zen LM models"],
)
for embedding in response.data:
print(f"Vector dim: {len(embedding.embedding)}")TypeScript
import Hanzo from '@hanzo/ai'
const client = new Hanzo({ apiKey: 'hk-your-key' })
const response = await client.embeddings.create({
model: 'zen-embedding',
input: ['Hello world', 'Zen LM models'],
})
for (const item of response.data) {
console.log(`Vector dim: ${item.embedding.length}`)
}Response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0091, 0.0152, "..."]
}
],
"model": "zen-embedding",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}Specifications
| Property | Value |
|---|---|
| Model | zen-embedding |
| Dimensions | 1,024 |
| Max Input | 8,191 tokens |
| Tier | pro max |
| Pricing | $0.39 / 1M tokens |
Use Cases
- Semantic search: Find similar documents by meaning
- RAG: Retrieval-augmented generation pipelines
- Clustering: Group similar texts together
- Classification: Use embeddings as features for classifiers
- Deduplication: Identify near-duplicate content at scale
Wire compatibility
The request and response bodies are the standard embeddings JSON shape, so an
HTTP client already written against that shape works here once its base URL
points at https://api.hanzo.ai/v1 and it sends a Hanzo key. Model ids do not
carry across vendors — zen-embedding is a Hanzo model and resolves only here.