API: Embeddings
OpenAI-compatible embeddings endpoint of the Kasimir Public API for 1024-dimensional vector embeddings.
The embeddings endpoint converts text into vectors that you can use for semantic search, clustering, classification or your own RAG applications. It is compatible with the OpenAI Embeddings API: you can use the official OpenAI SDK (or any OpenAI-compatible client) unchanged and only point base_url and api_key at Kasimir. Your company’s model approvals and budget apply.
Endpoint
Method |
|
URL |
|
Base URL |
|
Content-Type |
|
Auth |
|
Required scope |
|
OpenAI-compatible
In any OpenAI client, set base_url = "https://kasimir.ai/api/v1" and api_key = "<your-kasimir-key>". The request and response shapes mirror OpenAI's POST /v1/embeddings.
Authentication
Every call is authenticated with a company API key passed in the Authorization: Bearer <key> header.
Owners and admins create keys under Administration → Access.
A key starts with kasi_ and is shown in full only once at creation.
New keys have the scopes chat:read and chat:write by default. Embeddings require chat:write.
Revoked keys are rejected with 401.
Never put the key in client code
Treat the API key like a password. Use it server-side only and never commit it to a repository. If a key leaks, revoke it in /administration/access and create a new one.
Request
Headers
Header | Value | Required |
|---|---|---|
|
| yes |
|
| yes |
Body parameters
Parameter | Type | Required | Description |
|---|---|---|---|
|
| yes | The public model slug of an embedding model, e.g. |
|
| yes | The text to embed. Either a single string or an array of strings for batch embedding. |
Further OpenAI-compatible fields (e.g. encoding_format or dimensions) are passed on to the model if it supports them. Only model and input are required.
Response
The response follows the OpenAI embeddings schema. The model field contains the Kasimir slug.
Field | Type | Description |
|---|---|---|
|
| Always |
|
| List of embedding objects (see below). |
|
| The requested Kasimir model slug. |
|
| Token usage: |
Each element in data:
Field | Type | Description |
|---|---|---|
|
| Always |
|
| Position in the |
|
| The vector. For the default model, 1024 dimensions. |
The default model jina-embeddings-v3 (EU-hosted) returns vectors with 1024 dimensions.
Examples
curl — single text
curl https://kasimir.ai/api/v1/embeddings \
-H "Authorization: Bearer kasi_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jina-embeddings-v3",
"input": "The GDPR governs the handling of personal data."
}'curl — batch (multiple texts)
curl https://kasimir.ai/api/v1/embeddings \
-H "Authorization: Bearer kasi_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jina-embeddings-v3",
"input": [
"First paragraph to embed.",
"Second paragraph to embed."
]
}'OpenAI Python SDK
from openai import OpenAI
client = OpenAI(
base_url="https://kasimir.ai/api/v1",
api_key="kasi_YOUR_API_KEY",
)
resp = client.embeddings.create(
model="jina-embeddings-v3",
input="The GDPR governs the handling of personal data.",
)
vector = resp.data[0].embedding
print(len(vector)) # 1024
print(resp.usage.prompt_tokens)Batch with the Python SDK
texts = [
"First paragraph to embed.",
"Second paragraph to embed.",
]
resp = client.embeddings.create(model="jina-embeddings-v3", input=texts)
for item in resp.data:
print(item.index, len(item.embedding))Example response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0123, -0.0456, 0.0789, "...1021 more values..."]
}
],
"model": "jina-embeddings-v3",
"usage": {
"prompt_tokens": 12,
"total_tokens": 12
}
}Listing models
To discover which slugs are entitled for your workspace, use the models endpoint. It returns both chat and embedding models (filtered by your company’s approvals and EU setting):
curl https://kasimir.ai/api/v1/models \
-H "Authorization: Bearer kasi_YOUR_API_KEY"client.models.list()Errors
Errors are returned in the OpenAI error format so that standard SDKs handle them normally:
{
"error": {
"message": "Missing scope: chat:write",
"type": "permission_error",
"code": null
}
}The HTTP status code determines the type field:
Status |
| Cause |
|---|---|---|
|
| Invalid body (missing |
|
| No bearer token, invalid key, or revoked key. |
|
| Workspace monthly budget reached. |
|
| Missing scope ( |
|
| Model slug unknown or inactive. |
|
| Too many requests in a short time with this key. |
|
| Temporary processing error (e.g. |
Budget limit (402) If your company has set a monthly budget and the sum of API and in-app spend for the current calendar month reaches it, every call responds with 402. Without a budget there is no limit.
Governance & billing
Model approval: the same rules apply as in the app’s model picker – only active embedding models enabled for your company.
EU approval: models outside the EU are rejected with 403 unless your company has explicitly enabled them. The default model is EU-hosted.
Usage: every successful call is recorded with tokens and cost in euros and counts towards the monthly budget.
GDPR / data residency
The default embedding slug jina-embeddings-v3 is marked EU-hosted. If data residency is critical for you, verify via GET /api/v1/models that your chosen model is EU-hosted before embedding personal data.