Embedding 2
Zhipu AI Embedding 2 β text embedding model with fixed 1024-dim output.
Zhipu AI Embedding-2 is the second-generation text embedding model from Beijing-based Zhipu AI (ζΊθ°± AI), the research lab behind the GLM series of large language models. Published on the bigmodel.cn open platform, Embedding-2 converts text into fixed 1024-dimensional dense vectors for semantic similarity, retrieval, and ranking tasks. The model is designed for Chinese-English bilingual semantic understanding, with a single-string input limit of 512 tokens and a batch-mode input window of up to 8K tokens in total across all strings in the array.
Embedding-2 is Zhipu's previous-generation embedding API, superseded by Embedding-3 which adds adjustable output dimensions (256/512/1024/2048), a per-string 3K token limit, and matryoshka dimension reduction. For new projects, TheRouter recommends Embedding-3. Embedding-2 remains a practical option for teams with existing vector indexes built at 1024 dimensions who cannot yet migrate, and for workloads where a hard 512-token-per-chunk document chunking strategy is already in place. Pricing is identical to Embedding-3 at Β₯0.5/MTok (~$0.069/MTok via TheRouter).
- β’ Maintaining existing 1024-dim vector indexes: if your Pinecone, Weaviate, or pgvector collection is already built on Embedding-2 vectors, continuing with this model avoids full re-indexing costs
- β’ Semantic search over short Chinese-English snippets: news headlines, product titles, short reviews β where the 512-token per-item limit is never hit
- β’ Cost-sensitive high-volume embedding at the same Β₯0.5/MTok price as Embedding-3, with no upgrade friction if your chunking pipeline already targets β€512 tokens per chunk
- β’ New projects: use zhipu/embedding-3 instead β it offers variable dimensions (256β2048), a higher per-string limit (3K tokens), and matryoshka compression at the same price
- β’ Long-document embedding: passages longer than 512 tokens will be truncated; use Embedding-3 (3K/string limit) or a longer-context model such as OpenAI text-embedding-3-large (8K/string)
- β’ English-only or multilingual (non-Chinese) retrieval: OpenAI text-embedding-3-small or Cohere Embed V4 provide stronger MTEB coverage for non-Chinese corpora
Modalities
Pricing Breakdown
| Type | Rate |
|---|---|
| Input | $0.081 / 1M tokens |
Supported Parameters
Specifications
| Per-string input limit | 512 tokens (hard limit per string in the input array)docs.bigmodel.cn β API reference β | verified |
| Batch array total limit | 8,192 tokens total across all strings in the request arraydocs.bigmodel.cn β API reference β | verified |
| Output dimensions | 1024 (fixed β no dimension control)docs.bigmodel.cn β | verified |
| List price (Zhipu direct) | Β₯0.5 per million tokensdocs.bigmodel.cn β | verified |
| Modality | Text β embedding (text-only input; no image or audio support)docs.bigmodel.cn β | verified |
| Generation (successor) | Zhipu Embedding-3 (variable 256β2048 dim, 3K/string, matryoshka compression)docs.bigmodel.cn β | verified |
API Usage Examples
Use the global api.therouter.ai endpoint shown below for new integrations; the legacy China accelerated endpoint is retired.
curl https://api.therouter.ai/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $THE_ROUTER_API_KEY" -d '{
"model": "zhipu/embedding-2",
"messages": [
{"role": "user", "content": "Summarize the key points from this input."}
]
}'API guide
Embeddings (OpenAI-compatible)
Access Embedding-2 through the standard OpenAI /v1/embeddings endpoint at api.therouter.ai. Output is fixed at 1024 dimensions β the dimensions parameter is not supported for this model. Keep each input string under 512 tokens; the total token count across all strings in a batch must not exceed 8K.
curl https://api.therouter.ai/v1/embeddings \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zhipu/embedding-2",
"input": ["ζΊθ°± AI ζ―δΈε½ι’ε
η AI η η©ΆζΊζ", "Zhipu AI is a leading Chinese AI research lab"]
}'More from zhipu
Similar models
Cross-provider sibling modelsFrequently asked
Should I use Embedding-2 or Embedding-3?
For new projects, always use zhipu/embedding-3. It offers adjustable output dimensions (256/512/1024/2048), a higher per-string input limit (3K tokens vs 512), and matryoshka dimension compression β all at the same price (Β₯0.5/MTok). Embedding-2 is a valid choice only if you already have production vector indexes built at fixed 1024-dim that you cannot yet migrate, or if your document chunking strictly enforces β€512 tokens per chunk and you want to avoid a schema change.
What happens if my input string exceeds 512 tokens?
The Zhipu API will truncate the input to 512 tokens before computing the embedding. This means the tail of longer passages is silently dropped, which can degrade retrieval quality for long documents. Chunk your documents to β€512 tokens before calling Embedding-2, or migrate to zhipu/embedding-3 which raises the per-string limit to 3K tokens.
Can I use Embedding-2 with LangChain, LlamaIndex, or other OpenAI-compatible frameworks?
Yes. Set the base URL to https://api.therouter.ai/v1 and the model to zhipu/embedding-2. Do not pass the dimensions parameter β Embedding-2 ignores it and always returns 1024-dimensional vectors. Ensure your framework's chunking configuration caps documents at 512 tokens per chunk to avoid silent truncation.
Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Per-string input limit | docs.bigmodel.cn β API reference β | 2026-06-09 | verified |
| Batch array total limit | docs.bigmodel.cn β API reference β | 2026-06-09 | verified |
| Output dimensions | docs.bigmodel.cn β | 2026-06-09 | verified |
| List price (Zhipu direct) | docs.bigmodel.cn β | 2026-06-09 | verified |
| Modality | docs.bigmodel.cn β | 2026-06-09 | verified |
| Generation (successor) | docs.bigmodel.cn β | 2026-06-09 | verified |