Skip to main content

Embed Text

POST 

/v1/embedding/text

Generates text embeddings

nomic-embed-text was trained to support these tasks:

  • search_document (embedding document chunks for search & retrieval)
  • search_query (embedding queries for search & retrieval)
  • classification (embeddings for text classification)
  • clustering (embeddings for cluster visualization)

In the Nomic API or Python client, specify your task with the task_type parameter (default is search_document if no task_type is provided)

Using nomic-embed-text with other libraries requires you to use a prefix to specify your embedding task. See our HuggingFace model card for details.

Request

Body

required

    texts string[]required

    A batch of text you want embedded.

    model NomicTextEmbeddingModel

    Possible values: [nomic-embed-text-v1, nomic-embed-text-v1.5]

    An enumeration.

    task_type Task Type (string)

    Default value: search_document

    The downstream task to generate embeddings for. Options are search_document, search_query, classification, and clustering.

    long_text_mode LongTextHandlingMode

    Possible values: [truncate, mean]

    How to handle input texts longer than context length. Use truncate to cut off text after context length, or mean to get the mean of embedding vectors of chunks from your input text.

    max_tokens_per_text Max Tokens Per Text (integer)

    Default value: 8192

    Maximum amount of tokens per text. Defaults to 8192 if long_text_mode is "mean", or the maximum model input size if long_text_mode is "truncate".

    dimensionality Dimensionality (integer)

    Default value: 768

    Optionally reduce embedding dimensionality. Defaults to full-size embeddings if unspecified. Only applies to nomic-embed-text-v1.5.

Responses

Successful Response

Schema

    embeddings array[]required

    The embeddings

    usage

    object

    required

    prompt_tokens Prompt Tokens (integer)required

    The number of non-generated tokens ingested.

    total_tokens Total Tokens (integer)required

    The total tokens used.

    model NomicTextEmbeddingModelrequired

    Possible values: [nomic-embed-text-v1, nomic-embed-text-v1.5]

    An enumeration.

Loading...