Embeddings
POST /v1/embeddings
Convert text into vector representations for semantic search, clustering, and recommendations using OpenAI, Cohere, and Google embedding models.
Request
POST https://api.chuizi.ai/v1/embeddings
Authentication
Authorization: Bearer ck-your-api-key
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Model name, e.g. openai/text-embedding-3-small |
input | string/array | Yes | — | Text to encode. Single string or array of strings (max 2048 items) |
Available Models
| Model | Dimensions | Max Tokens |
|---|---|---|
openai/text-embedding-3-small | 1536 | 8191 |
openai/text-embedding-3-large | 3072 | 8191 |
cohere/embed-v4 | 1024 | 512 |
google/gemini-embedding-001 | 768 | 2048 |
Request Example
config.json
json
{ "model": "openai/text-embedding-3-small", "input": ["How to learn machine learning", "Machine learning beginner tutorial"], "encoding_format": "float" }
Response
config.json
json
{ "object": "list", "data": [ { "object": "embedding", "index": 0, "embedding": [0.0023064255, -0.009327292, 0.015797347, "..."] }, { "object": "embedding", "index": 1, "embedding": [-0.004843265, 0.012576489, -0.008321547, "..."] } ], "model": "openai/text-embedding-3-small", "usage": { "prompt_tokens": 14, "total_tokens": 14 } }
Code Examples
terminal
bash
curl -X POST https://api.chuizi.ai/v1/embeddings \ -H "Authorization: Bearer ck-your-key" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/text-embedding-3-small", "input": "Hello world" }'
Next Steps
- Rerank API — improve retrieval quality by reranking embedding results
- Choose a Model — compare embedding model dimensions and pricing
- Billing Model — understand how embedding requests are billed