BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Embeddings

Create embeddings

Converts text (or, for models that support it, multimodal content) into vector embeddings. Request and response shapes match OpenAI's embeddings API, so it works directly with client.embeddings.create(). input accepts a single string or an array of strings.

POST/api/v1/embeddings

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Body

modelrequired
string

The embeddings model to use, provider-qualified, e.g. "openai/text-embedding-3-small".

minLength: 1
Example: "openai/text-embedding-3-small"
inputrequired
string | string[]

The text to embed. Accepts a single string, or an array of strings to embed multiple inputs in one request. Some models additionally accept structured multimodal content items, forwarded to the upstream as-is; actual support depends on the model.

Example: "The quick brown fox"
encoding_format
string

Encoding format, forwarded to the upstream as-is with no local validation; supported values depend on the upstream.

Example: "float"
dimensions
integer

The number of dimensions for the output vector, forwarded to the upstream as-is with no local validation; only some models support custom dimensions, and the upstream decides the behavior (typically ignore or error) when unsupported.

provider
object

Provider routing preferences (order, only, ignore, allow_fallbacks, sort, …). Only forwarded and honored on certain model routes; unsupported routes drop it silently and never send it upstream.

POST /api/v1/embeddings
curl https://bazaarlink.ai/api/v1/embeddings \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/text-embedding-3-small",
    "input": "The quick brown fox"
  }'
Response examples

Success. Returns the OpenAI-compatible shape; data[] corresponds to each input in order, and usage.cost is the amount actually billed for this request.

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292,
        0.015797347
      ]
    }
  ],
  "model": "openai/text-embedding-3-small",
  "usage": {
    "prompt_tokens": 5,
    "total_tokens": 5,
    "cost": 1e-7
  }
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Create embeddings — BazaarLink API