Skip to main content
POST
Create embedding
Send text as input and get back OpenAI’s embeddings envelope: an object of list, a data array with one { object, index, embedding } entry per input, the resolved model, and usage. It is drop-in compatible with OpenAI’s Embeddings API, so an existing client only needs its base URL and model id changed. See the Embeddings guide for a prefilled example, or a model page (all-minilm-l6-v2, bge-small-en-v1.5) for an interactive playground. Embedding models are routable only on this endpoint. A /responses or /chat/completions call with an embedding model returns 400. Pass input as a string, or as an array of strings to embed a batch in one request; data[i].index maps each vector back to its input. Both models return 384-dimensional vectors, so they are interchangeable in an existing index. Embeddings are billed on input tokens only. usage carries prompt_tokens and total_tokens, and there are no output tokens to bill. Install the official SDK from npm or PyPI (pip install zerogpu-api). Source: zerogpu/SDK. Handle errors the same way as API error codes.

Authorizations

x-api-key
string
header
required

Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.

Headers

x-project-id
string

Optional project identifier. Scopes the request to a specific project when provided.

Body

application/json
model
enum<string>
required

Embedding model to use. Embedding models are routable only on this endpoint.

Available options:
all-minilm-l6-v2,
bge-small-en-v1.5
Example:

"all-minilm-l6-v2"

input
required

Text to embed. A single string, or an array of strings (one vector per element). Inputs are truncated at the model's max token length.

Minimum string length: 1

Response

Success

An OpenAI-compatible embedding list.

object
string
Example:

"list"

data
object[]
model
string

The resolved model id.

Example:

"all-MiniLM-L6-v2"

usage
object

Embeddings are billed on input tokens only; there are no output tokens.