---
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`

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

## Request body

- EmbedSparseRequest
  - `inputs` union, required
    - string
    - string[]
  - `truncate` boolean

## Response `200`

Embeddings

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

## Other responses

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

## Changes

- **2024-03-07** `e3df177c5175` — 1 info
  - endpoint added
- **2023-10-13** `8c00768ef703` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/huggingface/apis/text-embeddings-inference/changes/embed_sparse/post.md)

---

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