Text Embeddings Inference

Get Embeddings. Returns a 424 status code if the model is not an embedding model.

post/embed

Request body

dimensionsinteger nullable

The number of dimensions that the output embeddings should have. If not set, the original shape of the representation will be returned instead.

normalizeboolean
prompt_namestring nullable

The name of the prompt that should be used by for encoding. If not set, no prompt will be applied.

Must be a key in the sentence-transformers configuration prompts dictionary.

For example if prompt_name is "query" and the prompts is {"query": "query: ", ...}, then the sentence "What is the capital of France?" will be encoded as "query: What is the capital of France?" because the prompt text will be prepended before any text to encode.

truncateboolean nullable
truncation_direction'Left' | 'Right'

Example request

{
  "prompt_name": "null"
}

Response

Embeddings

number[] required

Example response

[
  [
    0,
    1,
    2
  ]
]

Changes

Changed in 4 of the 42 revisions of this API.3813

    • added the new Empty enum value to the error_type response property for the response status 413

      response-property-enum-value-added

    • added the new Empty enum value to the error_type response property for the response status 422

      response-property-enum-value-added

    • added the new Empty enum value to the error_type response property for the response status 424

      response-property-enum-value-added

    • added the new Empty enum value to the error_type response property for the response status 429

      response-property-enum-value-added

    • added the new optional request property dimensions

      new-optional-request-property

    • added the non-success response with the status 400

      response-non-success-status-added

  • b923798e386814See the full diff
    • removed subschema #1 subschema #2 from the inputs request property oneOf list

      request-property-one-of-removed

    • added the new optional request property prompt_name

      new-optional-request-property

    • added the new optional request property truncation_direction

      new-optional-request-property

    • the request property truncate became nullable

      request-property-became-nullable

    • added InputType subschema #2 to the inputs request property oneOf list

      request-property-one-of-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property normalize

      new-optional-request-property

  • 8c00768ef703246See the full diff
    • the request property truncate became not nullable

      request-property-became-not-nullable

    • removed InputType subschema #2 from the inputs request property oneOf list

      request-property-one-of-removed

    • removed the request property dimensions

      request-property-removed

    • removed the request property normalize

      request-property-removed

    • removed the request property prompt_name

      request-property-removed

    • removed the request property truncation_direction

      request-property-removed

    • added subschema #1 subschema #2 to the inputs request property oneOf list

      request-property-one-of-added

    • removed the non-success response with the status 400

      response-non-success-status-removed

    • removed the Empty enum value from the error_type response property for the response status 413

      response-property-enum-value-removed

    • removed the Empty enum value from the error_type response property for the response status 422

      response-property-enum-value-removed

    • removed the Empty enum value from the error_type response property for the response status 424

      response-property-enum-value-removed

    • removed the Empty enum value from the error_type response property for the response status 429

      response-property-enum-value-removed

    This revision also has 30 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog