Embeddings
OpenAI-compatible text embeddings. Reference for API version 2026-11-11.
On this page
Create embeddings
/api/v1/llm/v1/embeddings 768-dimensional float vectors from nebula-embed. Up to 256 inputs; each input at most 1,000 UTF-8 bytes, and the whole request at most 1,056 bytes including the task instruction added to each input. Metered at about 4 characters per token at the flat Nebula input rate. Requires llm:access or llm:embeddings.
Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Headers
Idempotency-KeystringRun this exact request at most once in 24 hours. A replay with the same key and the same body, from the same organization, user and API key, is refused with
409before any model call. See the Idempotency guide.- Minimum length
1
Request body
modelstring- Default
nebula-embed
inputstring or array of strings Requiredencoding_formatstringOnly
floatis supported; anything else is400. The OpenAI Python SDK sendsbase64when this is omitted, so passencoding_format="float"explicitly.- One of
float- Default
float
dimensionsinteger- One of
768- Default
768
task_typestringThe retrieval task the vectors are for. Use
RETRIEVAL_DOCUMENTwhen indexing andRETRIEVAL_QUERYwhen searching.- One of
SEMANTIC_SIMILARITYRETRIEVAL_QUERYRETRIEVAL_DOCUMENTCODE_RETRIEVAL_QUERYCLASSIFICATIONCLUSTERING- Default
SEMANTIC_SIMILARITY
userstring or null
Responses
200The embeddings, in input order.Body (application/json)
objectstring- Always
list
dataarray of objects3 fields in
dataobjectstring- Always
embedding
indexintegerembeddingarray of numbers
modelstringusageobject2 fields in
usageprompt_tokensintegertotal_tokensinteger
402The organization has no spendable credit, or its self-service spend cap is reached. Top up or raise the cap in the console. This status currently carriesmessage: "Error"andcode: "INTERNAL_9001"; rely on the HTTP status.Error envelope409This exact request (sameIdempotency-Keyand body) already ran, so it was not run again. Send a newIdempotency-Keyto run it again.Error envelope429A per-user limit was exceeded (the Platform API, embeddings or rerank). This response does not use the error envelope. Wait forRetry-Afterseconds.Headers
X-Request-IDstringThe request's correlation id (yours, or one BreachLine generated). Quote it to support.
Retry-AfterintegerSeconds to wait before retrying.
Body (application/json)
detailstring Requiredretry_afterinteger Required- Always
60
503A dependency is temporarily unavailable. Retry with backoff; honourRetry-Afterwhen present.Error envelope
Example
curl -X POST "https://api.breachline.io/api/v1/llm/v1/embeddings" \
-H "Authorization: Bearer $BREACHLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nebula-embed",
"input": "Session cookie set without the Secure flag",
"task_type": "RETRIEVAL_DOCUMENT"
}'
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0
]
}
],
"model": "string",
"usage": {
"prompt_tokens": 0,
"total_tokens": 0
}
}