Skip to main content

Embeddings

Preview

OpenAI-compatible text embeddings. Reference for API version next.

On this page
PreviewDownload OpenAPI (JSON)Versioning

Create embeddings

POST /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-Key string

    Run 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 409 before any model call. See the Idempotency guide.

    Minimum length
    1

Request body

application/json Required

  • model string
    Default
    nebula-embed
  • input string or array of strings Required
  • encoding_format string

    Only float is supported; anything else is 400. The OpenAI Python SDK sends base64 when this is omitted, so pass encoding_format="float" explicitly.

    One of
    float
    Default
    float
  • dimensions integer
    One of
    768
    Default
    768
  • task_type string

    The retrieval task the vectors are for. Use RETRIEVAL_DOCUMENT when indexing and RETRIEVAL_QUERY when searching.

    One of
    SEMANTIC_SIMILARITY RETRIEVAL_QUERY RETRIEVAL_DOCUMENT CODE_RETRIEVAL_QUERY CLASSIFICATION CLUSTERING
    Default
    SEMANTIC_SIMILARITY
  • user string or null

Responses

  • 200 The embeddings, in input order.

    application/json

    Body (application/json)

    • object string
      Always
      list
    • data array of objects
      3 fields in data
      • object string
        Always
        embedding
      • index integer
      • embedding array of numbers
    • model string
    • usage object
      2 fields in usage
      • prompt_tokens integer
      • total_tokens integer
  • 400 The request was malformed or failed a server-side check.Error envelope
  • 401 Missing, invalid, expired or revoked credentials.Error envelope
  • 402 The 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 carries message: "Error" and code: "INTERNAL_9001"; rely on the HTTP status.Error envelope
  • 403 The credential is valid but lacks a required scope or permission.Error envelope
  • 409 This exact request (same Idempotency-Key and body) already ran, so it was not run again. Send a new Idempotency-Key to run it again.Error envelope
  • 429 A per-user limit was exceeded (the Platform API, embeddings or rerank). This response does not use the error envelope. Wait for Retry-After seconds.

    application/json

    Headers

    • X-Request-ID string

      The request's correlation id (yours, or one BreachLine generated). Quote it to support.

    • Retry-After integer

      Seconds to wait before retrying.

    Body (application/json)

    • detail string Required
    • retry_after integer Required
      Always
      60
  • 503 A dependency is temporarily unavailable. Retry with backoff; honour Retry-After when present.Error envelope

Example

cURL
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"
  }'
Example 200 response
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0
      ]
    }
  ],
  "model": "string",
  "usage": {
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}

Search documentation

Type to search guides, the API reference, the CLI and the console guide.

    Enter open↑ ↓ moveEsc close