Not served on api.allternit.com. This page describes the gateway contract only.

Overview

The /v1/embeddings endpoint returns vector embeddings for one or more input strings. Allternit normalizes and validates the request, then proxies it to the configured embeddings provider — the response (vectors, model id, usage) comes straight from the provider. Without a configured provider the endpoint refuses: 501 allternit.not_configured. Deterministic hash-based embeddings exist for development and testing only, behind the ALLTERNIT_GATEWAY_ALLOW_FAKE_PROVIDERS=1 escape hatch, and are never served on production surfaces.

Provider configuration

The gateway proxies to the embeddings backend named by ALLTERNIT_GATEWAY_EMBED_URL — the full base URL of a compatible embeddings API, including /v1. When unset or empty, the endpoint returns 501 allternit.not_configured.
The end-user user field is accepted for attribution but is not forwarded to the provider.

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