Embeddings

Submit an embedding request

Submits an embedding request to the embeddings router

post/embeddings

Request body

dimensionsinteger

The number of dimensions for the output embeddings

encoding_format'float' | 'base64'

The format of the output embeddings

input_typestring

The type of input (e.g. search_query, search_document)

modelstring required

The model to use for embeddings

session_idstring

A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.

userstring

A unique identifier for the end-user

Example request

{
  "dimensions": 1536,
  "input": "The quick brown fox jumps over the lazy dog",
  "model": "openai/text-embedding-3-small"
}

Response

Embedding response

idstring

Unique identifier for the embeddings response

modelstring required

The model used for embeddings

object'list' required

Example response

{
  "data": [
    {
      "embedding": [
        0.0023064255,
        -0.009327292,
        0.015797347
      ],
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "openai/text-embedding-3-small",
  "object": "list",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Changes

Changed in 40 of the 303 revisions of this API.314100

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the new optional request property //////

      new-optional-request-property

    • ○

      added the new Respan enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Respan enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Respan enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new optional request property //////

      new-optional-request-property

    • ○

      added the new ScaleDown enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new ScaleDown enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new ScaleDown enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new Unbiased enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Unbiased enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Unbiased enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new TypeSafe enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new TypeSafe enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new TypeSafe enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new AssemblyAI enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new AssemblyAI enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new AssemblyAI enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Near AI enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Near AI enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new Near AI enum value to the request property //////////

      request-property-enum-value-added