Overview

The /v1/embeddings endpoint returns vector embeddings for one or more input strings. Allternit normalizes the request, routes it to the configured embeddings provider when available, and returns a consistent response shape. If no provider is configured, the gateway falls back to deterministic hash-based embeddings suitable for development and testing.

Base URL

For local development:

Endpoints

Create embeddings

Request body

Example request

Example response

Batch embedding

Pass an array of strings to embed multiple inputs in a single request. The order of data matches the order of input.

Base64 encoding

Request encoding_format: "base64" to receive embeddings as base64-encoded little-endian f32 bytes. The data[].embedding array is a placeholder when base64 is requested; decode the actual payload separately if your provider returns it.

Validation rules

  • input must contain at least one string and at most 2048 strings.
  • Each input string must be non-empty.
  • encoding_format must be float or base64.
  • dimensions must be between 1 and 3072.

Error codes