Request parameters
Header parameters
AuthorizationstringRequiredAPI key in the format Bearer <key>.
Example:
Bearer sk-zerofa-xxxContent-TypestringRequiredExample:
application/jsonBody parametersapplication/json
modelstringRequiredThe embedding model. See available models below.
Example:
<embedding-model>inputstring | string[]RequiredOne string or an array of strings for batching.
Example:
["What is ZeroFA?", "How do I integrate ZeroFA?"]encoding_formatstringOptionalEither float (default) or base64.
Example:
floatdimensionsintegerOptionalRequest a lower-dimensional output. Supported only by text-embedding-3-* models.
Example:
1024Usage tips
- Batching: include up to 100 entries in one input array and split larger workloads into batches.
- Embedding output is deterministic, so results for the same model and input can be cached.
- RAG: append retrieved content to the system message in a Chat Completions request.
Available models
See embedding models in the Model Catalog by filtering for Embedding, or retrieve them with GET /v1/models.
Request and response bodies
Use the examples below to verify the request and response structures. To send a request, select Debug at the top of the page.
curl https://zerofa.ai/v1/embeddings \
-H "Authorization: Bearer sk-zerofa-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "<embedding-model>",
"input": ["What is ZeroFA?", "How do I integrate ZeroFA?"]
}'Response · 200
{
"object": "list",
"data": [
{"object": "embedding", "index": 0, "embedding": [0.012, -0.034, ...]},
{"object": "embedding", "index": 1, "embedding": [...]}
],
"model": "<embedding-model>",
"usage": { "prompt_tokens": 12, "total_tokens": 12 }
}