Generate text embeddings through the Allternit LLM gateway
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.
# Any compatible embeddings backend you operate (self-hosted or cloud):ALLTERNIT_GATEWAY_EMBED_URL=https://embeddings.internal.example/v1
The end-user user field is accepted for attribution but is not forwarded to the provider.
Base URL
https://api.allternit.com/v1
For local development:
http://127.0.0.1:8013/v1
Endpoints
Method
Path
Description
POST
/v1/embeddings
Generate embeddings for one or more input texts
Create embeddings
Request body
Field
Type
Required
Description
input
string | string[]
yes
Text to embed. At least one non-empty string; at most 2048 strings.
model
string
no
Embedding model id. Defaults to allternit-embedding-3-small.
encoding_format
string
no
float or base64. Defaults to float.
dimensions
integer
no
Desired embedding dimension. Must be 1–3072. Defaults to 1536.
user
string
no
End-user identifier for attribution.
Example request
curl -X POST https://api.allternit.com/v1/embeddings \ -H "Authorization: Bearer $ALLTERNIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "allternit-embedding-3-small", "input": ["Allternit is the open alternative to locked-in AI vendors."] }'
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.