Embedding
Experimental1 creditEmbedding - generates dense vector embeddings with Matryoshka dimension support. Choose your embedding dimension (256, 512, 768, or 1024) to balance between quality and performance.
Production Recommendation
This is a direct endpoint for development and testing. For production workloads, use the Data Intelligence Pipeline -- it provides structured Data Packages with quality metrics, is async by default, and is covered by Enterprise SLAs.
Overview
The Embedding service generates dense vector embeddings with Matryoshka dimension support. Choose your embedding dimension (256, 512, 768, or 1024) to balance between quality and performance.
Key features:
- •Matryoshka embeddings - flexible dimensions (256-1024)
- •Automatic base64 decoding in SDK (returns float arrays)
- •High-throughput batch processing
- •Optimized for semantic search and retrieval
API Reference
https://api.latence.ai/api/v1/embedding/embedRequest Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | — | Input text (1-100,000 chars) | |
dimension | integer | — | Embedding dimension: 256, 512, 768, or 1024 | |
encoding_format | string | — | Output format: float or base64 |
Response Fields
| Field | Type | Description |
|---|
Response Example
{
"embeddings": [[0.123, -0.456, 0.789, ...]],
"dimension": 512,
"shape": [1, 512],
"encoding_format": "float",
"success": true,
"usage": { "credits": 0.1 }
}Code Examples
from latence import Latence
client = Latence(api_key="YOUR_API_KEY")
# Generate embeddings with Matryoshka dimension support
result = client.experimental.embedding.embed(
text="Artificial intelligence is transforming how we process information.",
dimension=512 # Choose from 256, 512, 768, 1024
)
print(result.embeddings) # Float array
print(result.shape) # [1, 512]Explore Tutorials & Notebooks
Deep-dive examples and interactive notebooks in our GitHub repository
Looking for production-grade processing?
The Data Intelligence Pipeline chains services automatically and returns structured Data Packages.