Kasimir Docs DEEN To the app →

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

POST

URL

https://kasimir.ai/api/v1/embeddings

Base URL

https://kasimir.ai/api/v1

Content-Type

application/json

Auth

Authorization: Bearer <api-key>

Required scope

chat:write

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

Authorization

Bearer <api-key>

yes

Content-Type

application/json

yes

Body parameters

Parameter

Type

Required

Description

model

string

yes

The public model slug of an embedding model, e.g. jina-embeddings-v3. Available slugs are returned by GET /api/v1/models.

input

string | string[]

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

object

string

Always "list".

data

array

List of embedding objects (see below).

model

string

The requested Kasimir model slug.

usage

object

Token usage: prompt_tokens, total_tokens.

Each element in data:

Field

Type

Description

object

string

Always "embedding".

index

number

Position in the input array.

embedding

number[]

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
  }
}
Request path of an embeddings call: auth, model governance, and budget check before the model call, then metering.
Request path of an embeddings call: auth, model governance, and budget check before the model call, then metering.

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

error.type

Cause

400

invalid_request_error

Invalid body (missing model/input or wrong type).

401

authentication_error

No bearer token, invalid key, or revoked key.

402

insufficient_quota

Workspace monthly budget reached.

403

permission_error

Missing scope (chat:write), model disabled for the workspace, non-EU model not enabled, or company suspended.

404

not_found_error

Model slug unknown or inactive.

429

invalid_request_error

Too many requests in a short time with this key.

>= 500

api_error

Temporary processing error (e.g. 502).

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.