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
- Python
- TypeScript
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]
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.mindshub.ai/v1",
apiKey: process.env.MINDSHUB_API_KEY,
});
const response = await client.embeddings.create({ model: "embed-small", input: ["first text", "second text"] });
const vectors = response.data.map((item) => item.embedding);
Request parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
model | string | yes | An embedding alias, currently embed-small (1,536 dimensions). |
input | string, array of strings, or token array(s) | yes | All OpenAI input forms are accepted. |
encoding_format | string | no | float (default) or base64. |
dimensions | integer | no | Forwarded to the model where supported. |
user | string | no | Forwarded. |
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-smallto/v1/chat/completionsfails upstream.
Errors
Errors use the OpenAI envelope and follow the standard taxonomy in Errors; upstream provider errors are relayed with their original status codes.