You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/inference-providers/pricing.md
+51-19Lines changed: 51 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,79 @@
1
1
# Pricing and Billing
2
2
3
-
Inference Providers is a production-ready service involving external partners and is therefore a paid product. However, as a Hugging Face user, you get monthly credits to run experiments. The amount of credits you get depends on your type of account:
3
+
Access 200+ models from leading AI inference providers with centralized, transparent, pay-as-you-go pricing. No infrastructure management required—just pay for what you use, with no markup from Hugging Face.
Your monthly credits automatically apply when you route requests through Hugging Face. For Enterprise organizations, credits are shared among all members.
18
+
19
+
</Tip>
20
+
21
+
## How Billing Works: Choose Your Approach
22
+
23
+
Inference Providers offers flexibility in how you're billed. Understanding these options upfront helps you choose the best approach for your needs:
24
+
25
+
| Feature |**Routed by Hugging Face**|**Custom Provider Key**|
26
+
| :--- | :--- | :--- |
27
+
|**How it Works**| Your request routes through HF to the provider | You set a custom provider key in HF settings |
28
+
|**Billing**| Pay-as-you-go on your HF account | Billed directly by the provider |
|**Provider Account Needed**|**❌ No** - We handle everything |**✅ Yes** - You need provider accounts |
31
+
|**Best For**| Simplicity, experimentation, consolidated billing | More billing control, using non-integrated providers |
32
+
|**Integration**| SDKs, Playground, widgets, Data AI Studio | SDKs, Playground, widgets, Data AI Studio |
33
+
34
+
### Which Option Should I Choose?
35
+
36
+
-**Start with Routed by Hugging Face** if you want simplicity and to use your monthly credits
37
+
-**Use Custom Provider Key** if you need specific provider features or you're consistently using the same provider
38
+
39
+
## Pay-as-you-Go Details
10
40
11
41
To benefit from Enterprise Hub included credits, you need to explicitly specify the organization to be billed when performing the inference requests.
12
42
See the [Organization Billing section](#organization-billing) below for more details.
13
43
14
-
## Pay-as-you-Go
44
+
**PRO users and Enterprise Hub organizations** can continue using the API after exhausting their monthly credits. This ensures uninterrupted access to models for production workloads.
15
45
16
-
**PRO users and Enterprise Hub organizations** can continue using the API once their monthly included credits are exhausted. This billing model, known as "Pay-as-you-Go" (PAYG), is charged on top of the monthly subscription. PAYG is only available for providers that are integrated with our billing system. We're actively working to integrate all providers, but in the meantime, any providers that are not yet integrated will be blocked once the free-tier limit is reached.
17
46
18
47
If you have remaining credits, we estimate costs for providers that aren’t fully integrated with our billing system. These estimates are usually higher than the actual cost to prevent abuse, which is why PAYG is currently disabled for those providers.
19
48
20
-
You can track your spending on your [billing page](https://huggingface.co/settings/billing).
21
-
22
49
<Tip>
23
50
24
51
Hugging Face charges you the same rates as the provider, with no additional fees. We just pass through the provider costs directly.
25
52
26
53
</Tip>
27
54
28
-
## Routed requests vs direct calls
55
+
You can track your spending anytime on your [billing page](https://huggingface.co/settings/billing).
29
56
30
-
The documentation above assumes you are making routed requests to external providers. In practice, there are 3 different ways to run inference, each with unique billing implications:
57
+
## Hugging Face Billing vs Custom Provider Key (Detailed Comparison)
31
58
32
-
-**Routed Request**: This is the default method for using Inference Providers. Simply use the JavaScript or Python `InferenceClient`, or make raw HTTP requests with your Hugging Face User Access Token. Your request is automatically routed through Hugging Face to the provider's platform. No separate provider account is required, and billing is managed directly by Hugging Face. This approach lets you seamlessly switch between providers without additional setup.
59
+
The documentation above assumes you are making routed requests to external providers. In practice, there are 3 different ways to run inference, each with unique billing implications:
33
60
34
-
-**Routed Request with Custom Key**: In your [settings page](https://huggingface.co/settings/inference-providers) on the Hub, you can configure a custom key for each provider. To use this option, you'll need to create an account on the provider's platform, and billing will be handled directly by that provider. Hugging Face won't charge you for the call. This method gives you more control over billing when experimenting with models on the Hub. When making a routed request with a custom key, your code remains unchanged—you'll still pass your Hugging Face User Access Token. Hugging Face will automatically swap the authentication when routing the request.
61
+
-**Hugging Face Routed Requests**: This is the default method for using Inference Providers. Simply use the JavaScript or Python `InferenceClient`, or make raw HTTP requests with your Hugging Face User Access Token. Your request is automatically routed through Hugging Face to the provider's platform. No separate provider account is required, and billing is managed directly by Hugging Face. This approach lets you seamlessly switch between providers without additional setup.
35
62
36
-
-**Direct Calls**: If you provide a custom key when using the JavaScript or Python `InferenceClient`, the call will be made directly to the provider's platform. Billing is managed by the provider, and Hugging Face is not notified of the request. This option is ideal if you want to use the unified `InferenceClient` interface without routing through Hugging Face.
63
+
-**Custom Provider Key**: You can bring your own provider key to use with the Inference Providers. This is useful if you already have an account with a provider and you want to use it with the Inference Providers. Hugging Face won't charge you for the call.
37
64
38
65
Here is a table that sums up what we've seen so far:
39
66
40
67
|| HF routing | Billed by | Free-tier included | Pay-as-you-go | Integration |
|**Routed request**| Yes | Hugging Face | Yes | Only for PRO users and for integrated providers | SDKs, Playground, widgets, Data AI Studio |
43
-
|**Routed request with custom key**| Yes | Provider | No | Yes | SDKs, Playground, widgets, Data AI Studio |
44
-
|**Direct call**| No | Provider | No | Yes | SDKs only |
69
+
|**Routed Requests**| Yes | Hugging Face | Yes | Only for PRO users and for integrated providers | SDKs, Playground, widgets, Data AI Studio |
70
+
|**Custom Provider Key**| Yes | Provider | No | Yes | SDKs, Playground, widgets, Data AI Studio |
71
+
72
+
<Tip>
73
+
74
+
You can set your custom provider key in the [settings page](https://huggingface.co/settings/inference-providers) on the Hub, or in the `InferenceClient` when using the JavaScript or Python SDKs. When making a routed request with a custom key, your code remains unchanged—you can still pass your Hugging Face User Access Token. Hugging Face will automatically swap the authentication when routing the request.
75
+
76
+
</Tip>
45
77
46
78
## HF-Inference cost
47
79
@@ -51,7 +83,7 @@ For instance, a request to [black-forest-labs/FLUX.1-dev](https://huggingface.co
51
83
52
84
The `"hf-inference"` provider is currently the default provider when working with the JavaScript and Python SDKs. Note that this default might change in the future.
53
85
54
-
## Organization billing
86
+
## Billing for Team and Enterprise organizations
55
87
56
88
For Enterprise Hub organizations, it is possible to centralize billing for all of your users. Each user still uses their own User Access Token but the requests are billed to your organization. This can be done by passing `"X-HF-Bill-To: my-org-name"` as a header in your HTTP requests.
0 commit comments