Embeddings

Vectors from kirin-embed-2, the one ZNSI model that is frozen, so stored vectors stay comparable.

Every response on this page was returned by the API when the page was built.

POST /v1/embeddings

Create embeddings.

kirin-embed-2 is frozen, so the same text always gets the same vector. Texts that share meaning-bearing words point the same way.

Request body

FieldTypeNotes
model Requiredstring One of kirin-embed-2.
input Requiredstring or arrayA string, a list of up to 2,048 strings, or token arrays.
encoding_formatstring One of float, base64.
dimensionsinteger 1 to 3072.
POST /v1/embeddingscurl
curl -X POST https://api.znsi.ai/v1/embeddings \
  -H "Authorization: Bearer $ZNSI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kirin-embed-2",
    "input": "Site 7 Hall C cooling report",
    "dimensions": 8
  }'
ResponseJSON
HTTP/1.1 200 OK
content-type: application/json
request-id: req_4b4319419c429a7223ab6bfd
x-ratelimit-remaining-requests: 12

{
  "data": [
    {
      "embedding": [
        -0.363865,
        -0.29312772,
        0.13567787,
        -0.010573415,
        -0.29026556,
        0.36397204,
        "… 2 more"
      ],
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "kirin-embed-2",
  "object": "list",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Errors

  • 400 Invalid request: a missing or invalid parameter, named in param.
  • 401 No key, or a key that is malformed, expired or revoked.
  • 404 Unknown route or model.
  • 413 Request body larger than 10 MB.
  • 429 Rate limited, or MUGEN is declining this caller for a while. See retry-after.