---
title: "Get Sparse Embeddings. Returns a 424 status code if the model is not an embedding model with SPLADE pooling."
method: POST
path: "/embed_sparse"
tags: ["Text Embeddings Inference"]
---

# Get Sparse Embeddings. Returns a 424 status code if the model is not an embedding model with SPLADE pooling.

`POST /embed_sparse`

## Request body

- EmbedSparseRequest
  - `inputs` union, required
    - union
      - string
      - integer[]
    - InputType[]
      - union
        - string
        - integer[]
  - `prompt_name` string, 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.
  - `truncate` boolean, nullable
  - `truncation_direction` 'Left' | 'Right'

## Response `200`

Embeddings

- array[]
  - SparseValue[]
    - `index` integer, required
    - `value` number, float, required

## Other responses

- `400` — Batch is empty
- `413` — Batch size error
- `422` — Tokenization error
- `424` — Embedding Error
- `429` — Model is overloaded

---

[API](https://skmtc.net/huggingface/apis/text-embeddings-inference.md) · [All operations](https://skmtc.net/huggingface/apis/text-embeddings-inference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huggingface/text-embeddings-inference/versions/f4c15add6d2b/schema)
