# HuggingFaceInferenceAPIEmbeddings

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/embeddings/huggingface/HuggingFaceInferenceAPIEmbeddings)

Embed texts using the HuggingFace API.

Requires a HuggingFace Inference API key and a model name.

## Signature

```python
HuggingFaceInferenceAPIEmbeddings()
```

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `api_key`
- `model_name`
- `api_url`
- `additional_headers`
- `model_config`

## Methods

- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/huggingface/HuggingFaceInferenceAPIEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/huggingface/HuggingFaceInferenceAPIEmbeddings/embed_query)

## ⚠️ Deprecated

Deprecated since version 0.2.2.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/embeddings/huggingface.py#L408)