Embeddings
Converts text into vectors for semantic search, RAG, clustering, and recommendations.
RequestREQUEST
POST
https://test.kailin.com.cn/v1/embeddingsResponseRESPONSE
Fill in the request and hit Send — the response shows up here
Request
curl https://test.kailin.com.cn/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "text-embedding-3-small",
"input": "AI Station is a unified model gateway"
}'
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Embedding model, e.g. text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002 |
input | string / array | Yes | A string or an array of strings (batch) — per-request limits depend on the model |
dimensions | integer | No | Output vector dimensions (text-embedding-3 series supports dimension reduction) |
encoding_format | string | No | float (default) or base64 |
user | string | No | End-user identifier |
Response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0091, 0.0154, "..."]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 12,
"total_tokens": 12
}
}
| Field | Description |
|---|---|
data[].embedding | Vector array — default 1536 dimensions (text-embedding-3-small) / 3072 (-large) |
data[].index | Index of the corresponding input string |
usage.prompt_tokens | Billed token count |
Batch Requests
{
"model": "text-embedding-3-small",
"input": ["first document", "second document", "third document"]
}
The returned data carries index matching the input order. A single batched call is faster and cheaper on request count than per-item calls.
Using the SDK
from openai import OpenAI
client = OpenAI(
api_key="sk-your-token",
base_url="https://test.kailin.com.cn/v1",
)
resp = client.embeddings.create(
model="text-embedding-3-small",
input=["Document A", "Document B"],
)
vectors = [item.embedding for item in resp.data]
note
Gemini-native embedding endpoints (/v1beta/models/{model}:embedContent etc.) are also proxied — parameters follow the Gemini official format, see Google's documentation.