Skip to main content
POST
/
api
/
public
/
v1
/
embeddings
Embeddings
curl --request POST \
  --url https://mibyanai.com/api/public/v1/embeddings
{
  "model": "<string>",
  "input": {},
  "object": "<string>",
  "data": [
    {
      "object": "<string>",
      "index": 123,
      "embedding": [
        {}
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}
Generates a vector representation (embeddings) of the input text. This endpoint is fully compatible with the OpenAI Embeddings API.

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringYesMust be set to Bearer <your-api-key> (starts with mb-).
Content-TypestringYesMust be set to application/json.
x-mibyan-api-keystringNoAlternative way to pass your API key.

Request Body

model
string
default:"mibyan-embed-1"
The embedding model to use.
  • mibyan-embed-1: High-dimensional text embedding model optimized for semantic search and retrieval-augmented generation (RAG). (3072 dimensions)
  • mibyan-embed-small: A fast, lightweight embedding model suitable for lower-latency semantic tasks. (1536 dimensions)
input
string or array
required
Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings.

Response Body

object
string
The object type, always list.
data
array
A list of embedding objects.
model
string
The model used to generate the embeddings.
usage
object
Usage statistics for the request.

Examples

cURL (Single Input)

curl https://mibyanai.com/api/public/v1/embeddings \
  -H "Authorization: Bearer mb-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mibyan-embed-1",
    "input": "The quick brown fox jumps over the lazy dog"
  }'

cURL (Multiple Inputs)

curl https://mibyanai.com/api/public/v1/embeddings \
  -H "Authorization: Bearer mb-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mibyan-embed-small",
    "input": [
      "The quick brown fox",
      "jumps over the lazy dog"
    ]
  }'

Response Example (JSON)

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.025527944,
        0.012395841,
        "..."
      ]
    }
  ],
  "model": "mibyan-embed-1",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}