# https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-MiniLM-L6-v2

**URL:** <https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574>\
**Category:** Beginners\
**Created:** [May 5, 2025, 1:08pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574 "2025-05-05T13:08:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RanuSujeet](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@RanuSujeet](https://discuss.huggingface.co/u/RanuSujeet)\
**Post date:** [May 5, 2025, 1:08pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/1 "2025-05-05T13:08:03Z")

</div>

Hello All,

I am using sentence-transformers/paraphrase-MiniLM-L6-v2 while using the API. but getting the 404 error. We are in free plan. any help please

---

<div class="post-metadata">

**Author:** ![RanuSujeet](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@RanuSujeet](https://discuss.huggingface.co/u/RanuSujeet)\
**Post date:** [May 5, 2025, 3:18pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/2 "2025-05-05T15:18:21Z")

</div>

Hello All, Its seems no model is accessiable via API access..iPlease confirm if any one is also facing the same issue.

import requests

# ✅ API key must be in quotes

API\_TOKEN = “hf”  
API\_URL = “[https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-MiniLM-L6-v2](https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-MiniLM-L6-v2)”

headers = {“Authorization”: f"Bearer {API\_TOKEN}"}

def test\_huggingface\_api():  
data = {  
“inputs”: “This is a test sentence.”  
}  
response = requests.post(API\_URL, headers=headers, json=data)

```
print("Status Code:", response.status_code)
if response.ok:
    print("API is working ✅")
    print("Response:", response.json())
else:
    print("API error ❌")
    print("Error Message:", response.text)

```

test\_huggingface\_api()

OutPut ::::Status Code: 404  
API error ❌  
Error Message: Not Found

---

<div class="post-metadata">

**Author:** ![Eddy872](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/eddy872/32/46936_2.png) [@Eddy872](https://discuss.huggingface.co/u/Eddy872)\
**Post date:** [May 5, 2025, 6:49pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/3 "2025-05-05T18:49:24Z")

</div>

I have the same problem, the Inference API still returns a 404 error when calling curl in bash, client in Python or visit the url in interface web.

---

<div class="post-metadata">

**Author:** ![marioluigi112](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@marioluigi112](https://discuss.huggingface.co/u/marioluigi112)\
**Post date:** [May 5, 2025, 7:42pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/4 "2025-05-05T19:42:00Z")

</div>

> [@RanuSujeet](#):
>
> e issue.
> 
> import requests
> 
> # ✅ API

Please make sure to hide or remove your API token, it’s not secure to post it publicly.

---

<div class="post-metadata">

**Author:** ![Zelgodiz](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/zelgodiz/32/45662_2.png) [@Zelgodiz](https://discuss.huggingface.co/u/Zelgodiz)\
**Post date:** [May 5, 2025, 9:28pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/5 "2025-05-05T21:28:39Z")

</div>

It looks like you’re receiving a **404 error** when trying to access `sentence-transformers/paraphrase-MiniLM-L6-v2` via the Hugging Face API. This usually happens if the model is unavailable or there’s API endpoint. Here’s how you can fix it:

1. **Check Model Availability:** Visit the [model’s page](https://huggingface.co/sentence-transformers/paraphrase-MiniLM-L6-v2) to ensure it’s still hosted. If it’s been removed, you may need to find an alternative.

2. **Verify API Endpoint:** Make sure you’re using the correct API request. The right format should be:

3. **Free Plan Limitations:** Some models require authentication or a paid plan. If you’re using the free tier, make sure the model is accessible to free users. You may need to run it locally instead.

If these steps don’t resolve the issue, let me know what error message you’re getting, and I’ll be happy to assist further!

**Best,**

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [May 5, 2025, 9:56pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/6 "2025-05-05T21:56:08Z")

</div>

Don’t forget to disable the token that has been leaked.

Currently, almost all models for users are returning 404 errors. @michellehbn

---

<div class="post-metadata">

**Author:** ![RanuSujeet](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@RanuSujeet](https://discuss.huggingface.co/u/RanuSujeet)\
**Post date:** [May 6, 2025, 9:13am UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/7 "2025-05-06T09:13:03Z")

</div>

Thanks , this has been removed and deleted as well

---

<div class="post-metadata">

**Author:** ![ebearden](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ebearden/32/46689_2.png) [@ebearden](https://discuss.huggingface.co/u/ebearden)\
**Post date:** [May 8, 2025, 3:03pm UTC](https://discuss.huggingface.co/t/https-api-inference-huggingface-co-models-sentence-transformers-paraphrase-minilm-l6-v2/153574/8 "2025-05-08T15:03:59Z")

</div>

I couldn’t find much on the matter.

import requests

API\_URL = “[https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-MiniLM-L6-v2](https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-MiniLM-L6-v2)”  
your\_token = “your\_actual\_api\_token”  
input\_text = “Your actual text here”

headers = {“Authorization”: f"Bearer {your\_token}"}  
response = requests.post(API\_URL, headers=headers, json={“inputs”: input\_text})

if response.status\_code == 404:  
print(“Model not found or API URL is incorrect”)  
elif response.status\_code == 401:  
print(“Invalid API token”)  
elif response.status\_code == 429:  
print(“Rate limit exceeded”)  
else:  
print(“Error:”, response.text)  
This code snippet appears to be testing the Hugging Face API using the `requests` library in Python. Let’s break it down:

1. It sends a POST request to the API with a JSON payload containing the input text.
2. It checks the response status code and prints out a success or error message accordingly.
3. If the response is OK (200-299 status code), it prints the JSON response.
4. If there’s an error, it prints the status code and the error message.

The code seems mostly correct, but here are a few potential issues:

1. The variable `your_token` should be replaced with an actual API token.
2. The input text “Your text here” should be replaced with the actual text you want to process.
3. Error handling could be improved, such as catching exceptions or handling specific error codes.

Here’s a slightly modified version with some improvements:

```auto
import requests
import json

API_URL = "https://api-inference.huggingface.co/models/sentence-transformers/paraphrase-MiniLM-L6-v2"
your_token = "your_actual_api_token" # Replace with your API token
input_text = "Your actual text here" # Replace with your input text

headers = {"Authorization": f"Bearer {your_token}"}
response = requests.post(API_URL, headers=headers, json={"inputs": input_text})

if response.ok:
    print("API is working ")
    print("Response:", response.json())
else:
    print("API error ")
    print("Status Code:", response.status_code)
    print("Error Message:", response.text)

```

Make sure to replace `your_actual_api_token` and `Your actual text here` with your actual API token and input text, respectively.
