LLM
Create embeddings
POST
Creates embedding vectors from text or media inputs. Text-only requests return one vector per input, useful for retrieval, semantic search, clustering, classification, and RAG. Requests containing media (images, audio, or video as base64 data URIs) fuse all inputs into a single cross-modal vector — embed each asset in its own request when you need one vector per asset. Compatible with the OpenAI Embeddings API format. Streaming is not supported on this endpoint.
Authentication
Bearer token. Use your API key as the bearer token in the Authorization header.Format:
Bearer <SUNRA_KEY>Request
This endpoint expects an object.ID of the embedding model to use, e.g.
google/gemini-embedding-2. See the models page for available embedding models.Inputs to embed, as a single string or an array of strings. Text-only inputs are embedded independently, returning one vector per input in input order. Media inputs are passed as base64 data URIs (
data:image/png;base64,…, data:audio/mpeg;base64,…, data:video/mp4;base64,…) and may be mixed with text — but any request containing media returns a single fused vector for all inputs combined. Limits (upstream): at most 6 images per request, video up to 120 seconds, and a combined budget of 8,192 tokens across all modalities (text tokens; images count 258 tokens each, audio 25 tokens/second, video 66 tokens/second).The number of dimensions for the output embeddings. Only supported by models with flexible output dimensions (Matryoshka Representation Learning). For
google/gemini-embedding-2 the default is 3072, and values from 128 to 3072 are supported. Smaller values truncate the vector while preserving most semantic quality.The format of the returned embeddings. Either
float (default) or base64.Response
Always
list.A list of embedding objects, one per input, in input order.
The model used to create the embeddings.
Token usage for the request. Embeddings are billed on input tokens only, with modality-specific rates (see the model page for pricing). Media requests include per-modality token counts.