---
title: "Create embeddings"
method: POST
path: "/v1/embeddings"
tags: ["Embeddings"]
---

# Create embeddings

`POST /v1/embeddings`

## Request

- Base URL: `https://api.sandbase.ai`
- URL: `https://api.sandbase.ai/v1/embeddings`
- Auth: HTTP bearer

OpenAI-compatible embeddings endpoint for semantic search, RAG, clustering, and classification. SandBase validates the logical model and forwards provider-compatible embedding fields; model-specific constraints are defined by the selected model and upstream provider.

## Request body

- EmbeddingRequest: OpenAI-compatible request. Additional provider-compatible fields are forwarded unchanged.
  - `model` string, required: Embedding model identifier.
  - `input` union, required: Text, token IDs, or a batch of texts or token-ID arrays to embed. Provider limits apply.
    - string
    - string[]
    - integer[]
    - array[]
      - integer[]
  - `dimensions` integer: Optional output dimension when supported by the selected model. SandBase does not impose a universal dimension list.
  - `encoding_format` 'float' | 'base64': Requested embedding encoding. Support is provider- and model-specific.

## Response `200`

Embedding response

- EmbeddingResponse
  - `object` 'list', required
  - `data` object[], required
    - `object` 'embedding', required
    - `index` integer, required
    - `embedding` union, required
      - number[]
      - string: Base64-encoded vector when encoding_format is base64.
  - `model` string, required
  - `usage` object, required
    - `prompt_tokens` integer, required
    - `total_tokens` integer, required

## Other responses

- `400`: Invalid request or non-embedding model
- `401`: Missing or invalid API key
- `402`: Organization or API Key spending limit reached
- `403`: Organization is disabled, or the API key scope does not authorize this endpoint
- `404`: Logical model not found
- `500`: Request persistence or organization lookup failed
- `503`: No provider route succeeded

---

[API](https://skmtc.dev/sandbase/apis/sandbase-api.md) · [All operations](https://skmtc.dev/sandbase/apis/sandbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbase/apis/sandbase-api/revisions/d40df2467ba2?raw)
