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/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

Unsupported. The entire object is ignored and removed before forwarding; it cannot select an upstream or price tier.

POST /v1/embeddings
curl https://api.bazaarlink.ai/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. usage.cost is the USD amount charged to the customer for this request. The opaque BazaarLink request id in the response matches x-request-id; use it with GET /v1/generation. Stats may take a few seconds after completion; retry a 404 briefly. The non-streaming response also returns the same id in x-generation-id.

{
  "id": "85e6f35c71a31f19-SJC",
  "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