I am getting this error only Inference Providers with accurate pricing are available for organizations

Since today, whenever i try to use API with following strucutre

import os
from openai import OpenAI

client = OpenAI(
base_url=“https://router.huggingface.co/v1”,
api_key=“key”,
default_headers={
“X-HF-Bill-To”: “org”
}
)

completion = client.chat.completions.create(
model=“deepseek-ai/DeepSeek-V3-0324:together”,
messages=[
{
“role”: “user”,
“content”: “What is the capital of France?”
}
],
)

print(completion.choices[0].message)

i am getting this error.

only Inference Providers with accurate pricing are available for organizations.

1 Like

I’m not sure if it’s related to the error, but there seems to have been a major change.

Hey @HA01AI Are you still seeing this error message?

1 Like

Hi yes sadly i am still receiving same error.

here is my test code which i copied from huggingface

import os
from openai import OpenAI

client = OpenAI(
base_url=“https://router.huggingface.co/v1”,
api_key=“KEY”,
default_headers={
“X-HF-Bill-To”: “artglobal”
}
)

completion = client.chat.completions.create(
model=“deepseek-ai/DeepSeek-V3-0324:together”,
messages=[
{
“role”: “user”,
“content”: “What is the capital of France?”
}
],
)

print(completion.choices[0].message)

1 Like

as user mentioned yes i am facing this error after this change.

1 Like

Yes it is related to this, after this change i am getting error. old api’s still work

1 Like

for this request library based example i am getting the same error

import os
import requests

API_URL = “https://router.huggingface.co/v1/chat/completions
headers = {
“Authorization”: f"Bearer hf_*****",
“X-HF-Bill-To”: “artglobal”
}

def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()

response = query({
“messages”: [
{
“role”: “user”,
“content”: “What is the capital of France?”
}
],
“model”: “moonshotai/Kimi-K2-Instruct:together”
})

print(response)

also i like to mention that when i remove the “X-HF-Bill-To”: “artglobal” i don’t get error

1 Like

It looks like your organization account isn’t getting billed or the “X-HF-Bill-To” header isn’t being passed. We have some documentation for billing your organization, with some examples, here: Pricing and Billing.

If you’re still experiencing issues after adjusting the header, let me know!

1 Like

The billing is currently being processed through the old API, where we were required to specify the provider’s name, for example, like this: https://router.huggingface.co/fireworks-ai/inference/v1. It used to work perfectly fine, but today, after the recent changes, it started experiencing issues."

1 Like

Hi , i am still facing this issue even after adjusting the header

1 Like