Skip to main content

Embeddings

POST /v1/embeddings follows the OpenAI embeddings shape. Embedding models are a separate part of the catalog: they carry "embedding": true in GET /v1/models and can't chat, and chat models can't embed.

Endpoint​

POST https://api.mindshub.ai/v1/embeddings

Quick example​

import os
from openai import OpenAI

client = OpenAI(
base_url="https://api.mindshub.ai/v1",
api_key=os.environ["MINDSHUB_API_KEY"],
)

response = client.embeddings.create(model="embed-small", input=["first text", "second text"])
vectors = [item.embedding for item in response.data]

Request parameters​

ParameterTypeRequiredNotes
modelstringyesAn embedding alias, currently embed-small (1,536 dimensions).
inputstring, array of strings, or token array(s)yesAll OpenAI input forms are accepted.
encoding_formatstringnofloat (default) or base64.
dimensionsintegernoForwarded to the model where supported.
userstringnoForwarded.

Request body​

The full request and response schemas are on the generated reference page: POST /v1/embeddings.

Response​

{
"object": "list",
"data": [
{"object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, 0.0789]}
],
"model": "text-embedding-3-small",
"usage": {"prompt_tokens": 4, "total_tokens": 4}
}

The real embedding array has 1,536 values; it's truncated here. model names the model that served, as on the chat endpoints. Embedding calls are input-only: usage has prompt_tokens and total_tokens, no completion tokens.

Lane-specific behaviour​

  • Embeddings always bill to the wallet and never draw the included allowance: an empty wallet refuses them like any other paid request. The rate is low ($0.02 per million tokens), but it isn't free.
  • Sending embed-small to /v1/chat/completions fails upstream.

Errors​

Errors use the OpenAI envelope and follow the standard taxonomy in Errors; upstream provider errors are relayed with their original status codes.