Buckets:

rtrm's picture
download
raw
30.2 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Pricing and Billing&quot;,&quot;local&quot;:&quot;pricing-and-billing&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Free Credits to Get Started&quot;,&quot;local&quot;:&quot;free-credits-to-get-started&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;How Billing Works: Choose Your Approach&quot;,&quot;local&quot;:&quot;how-billing-works-choose-your-approach&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Which Option Should I Choose?&quot;,&quot;local&quot;:&quot;which-option-should-i-choose&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Pay-as-you-Go Details&quot;,&quot;local&quot;:&quot;pay-as-you-go-details&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Hugging Face Billing vs Custom Provider Key (Detailed Comparison)&quot;,&quot;local&quot;:&quot;hugging-face-billing-vs-custom-provider-key-detailed-comparison&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;HF-Inference cost&quot;,&quot;local&quot;:&quot;hf-inference-cost&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Billing for Team and Enterprise organizations&quot;,&quot;local&quot;:&quot;billing-for-team-and-enterprise-organizations&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/inference-providers/pr_1821/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/entry/start.652aa0ea.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/scheduler.2427eaa0.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/singletons.342bf38a.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/index.2f106b1a.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/paths.fbcfdda0.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/entry/app.8c7cd661.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/index.cf54e274.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/nodes/0.f29beee7.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/nodes/7.65a7a335.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/Tip.ba8beabf.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/CodeBlock.1a8c1d5b.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/getInferenceSnippets.f04a0048.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/HfOption.fdf803e5.js">
<link rel="modulepreload" href="/docs/inference-providers/pr_1821/en/_app/immutable/chunks/utils.c64e5560.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Pricing and Billing&quot;,&quot;local&quot;:&quot;pricing-and-billing&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Free Credits to Get Started&quot;,&quot;local&quot;:&quot;free-credits-to-get-started&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;How Billing Works: Choose Your Approach&quot;,&quot;local&quot;:&quot;how-billing-works-choose-your-approach&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Which Option Should I Choose?&quot;,&quot;local&quot;:&quot;which-option-should-i-choose&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Pay-as-you-Go Details&quot;,&quot;local&quot;:&quot;pay-as-you-go-details&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Hugging Face Billing vs Custom Provider Key (Detailed Comparison)&quot;,&quot;local&quot;:&quot;hugging-face-billing-vs-custom-provider-key-detailed-comparison&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;HF-Inference cost&quot;,&quot;local&quot;:&quot;hf-inference-cost&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Billing for Team and Enterprise organizations&quot;,&quot;local&quot;:&quot;billing-for-team-and-enterprise-organizations&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="pricing-and-billing" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#pricing-and-billing"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Pricing and Billing</span></h1> <p data-svelte-h="svelte-7aoc4z">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.</p> <h2 class="relative group"><a id="free-credits-to-get-started" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#free-credits-to-get-started"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Free Credits to Get Started</span></h2> <p data-svelte-h="svelte-1hmz1xw">Every Hugging Face user receives monthly credits to experiment with Inference Providers:</p> <table data-svelte-h="svelte-12r3yqp"><thead><tr><th>Account Type</th> <th>Monthly Credits</th> <th>Extra usage (pay-as-you-go)</th></tr></thead> <tbody><tr><td>Free Users</td> <td>$0.10, subject to change</td> <td>no</td></tr> <tr><td>PRO Users</td> <td>$2.00</td> <td>yes</td></tr> <tr><td>Team or Enterprise Organizations</td> <td>$2.00 per seat</td> <td>yes</td></tr></tbody></table> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-1tgn4fd">Your monthly credits automatically apply when you route requests through Hugging Face. For Team or Enterprise organizations, credits are shared among all members.</p></div> <h2 class="relative group"><a id="how-billing-works-choose-your-approach" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#how-billing-works-choose-your-approach"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>How Billing Works: Choose Your Approach</span></h2> <p data-svelte-h="svelte-1w5y508">Inference Providers offers flexibility in how you’re billed. Understanding these options upfront helps you choose the best approach for your needs:</p> <table data-svelte-h="svelte-u7vf0s"><thead><tr><th align="left">Feature</th> <th align="left"><strong>Routed by Hugging Face</strong></th> <th align="left"><strong>Custom Provider Key</strong></th></tr></thead> <tbody><tr><td align="left"><strong>How it Works</strong></td> <td align="left">Your request routes through HF to the provider</td> <td align="left">You set a custom provider key in HF settings</td></tr> <tr><td align="left"><strong>Billing</strong></td> <td align="left">Pay-as-you-go on your HF account</td> <td align="left">Billed directly by the provider</td></tr> <tr><td align="left"><strong>Monthly Credits</strong></td> <td align="left"><strong>✅ Yes</strong> - Credits apply to eligible providers</td> <td align="left"><strong>❌ No</strong> - Credits don’t apply</td></tr> <tr><td align="left"><strong>Provider Account Needed</strong></td> <td align="left"><strong>❌ No</strong> - We handle everything</td> <td align="left"><strong>✅ Yes</strong> - You need provider accounts</td></tr> <tr><td align="left"><strong>Best For</strong></td> <td align="left">Simplicity, experimentation, consolidated billing</td> <td align="left">More billing control, using non-integrated providers</td></tr> <tr><td align="left"><strong>Integration</strong></td> <td align="left">SDKs, Playground, widgets, Data AI Studio</td> <td align="left">SDKs, Playground, widgets, Data AI Studio</td></tr></tbody></table> <h3 class="relative group"><a id="which-option-should-i-choose" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#which-option-should-i-choose"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Which Option Should I Choose?</span></h3> <ul data-svelte-h="svelte-198a5b1"><li><strong>Start with Routed by Hugging Face</strong> if you want simplicity and to use your monthly credits</li> <li><strong>Use Custom Provider Key</strong> if you need specific provider features or you’re consistently using the same provider</li></ul> <h2 class="relative group"><a id="pay-as-you-go-details" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#pay-as-you-go-details"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Pay-as-you-Go Details</span></h2> <p data-svelte-h="svelte-1ugzym0">To benefit from Enterprise Hub included credits, you need to explicitly specify the organization to be billed when performing the inference requests.
See the <a href="#organization-billing">Organization Billing section</a> below for more details.</p> <p data-svelte-h="svelte-cz5h1t"><strong>PRO users and Enterprise Hub organizations</strong> can continue using the API after exhausting their monthly credits. This ensures uninterrupted access to models for production workloads.</p> <p data-svelte-h="svelte-hbomte">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.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-fcw0wf">Hugging Face charges you the same rates as the provider, with no additional fees. We just pass through the provider costs directly.</p></div> <p data-svelte-h="svelte-cg3sv6">You can track your spending anytime on your <a href="https://huggingface.co/settings/billing" rel="nofollow">billing page</a>.</p> <h2 class="relative group"><a id="hugging-face-billing-vs-custom-provider-key-detailed-comparison" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#hugging-face-billing-vs-custom-provider-key-detailed-comparison"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Hugging Face Billing vs Custom Provider Key (Detailed Comparison)</span></h2> <p data-svelte-h="svelte-1yrvom4">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:</p> <ul data-svelte-h="svelte-1jlv6fa"><li><p><strong>Hugging Face Routed Requests</strong>: This is the default method for using Inference Providers. Simply use the JavaScript or Python <code>InferenceClient</code>, 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.</p></li> <li><p><strong>Custom Provider Key</strong>: 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.</p></li></ul> <p data-svelte-h="svelte-1b2o2p1">Here is a table that sums up what we’ve seen so far:</p> <table data-svelte-h="svelte-12y2q34"><thead><tr><th></th> <th>HF routing</th> <th>Billed by</th> <th>Free-tier included</th> <th>Pay-as-you-go</th> <th>Integration</th></tr></thead> <tbody><tr><td><strong>Routed Requests</strong></td> <td>Yes</td> <td>Hugging Face</td> <td>Yes</td> <td>Only for PRO users and for integrated providers</td> <td>SDKs, Playground, widgets, Data AI Studio</td></tr> <tr><td><strong>Custom Provider Key</strong></td> <td>Yes</td> <td>Provider</td> <td>No</td> <td>Yes</td> <td>SDKs, Playground, widgets, Data AI Studio</td></tr></tbody></table> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-q2sd2g">You can set your custom provider key in the <a href="https://huggingface.co/settings/inference-providers" rel="nofollow">settings page</a> on the Hub, or in the <code>InferenceClient</code> 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.</p></div> <h2 class="relative group"><a id="hf-inference-cost" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#hf-inference-cost"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>HF-Inference cost</span></h2> <p data-svelte-h="svelte-1yovgaz">As you may have noticed, you can select to work with <code>&quot;hf-inference&quot;</code> provider. This service used to be called “Inference API (serverless)” prior to Inference Providers. From a user point of view, working with HF Inference is the same as with any other provider. Past the free-tier credits, you get charged for every inference request based on the compute time x price of the underlying hardware.</p> <p data-svelte-h="svelte-xg5589">For instance, a request to <a href="https://huggingface.co/black-forest-labs/FLUX.1-dev" rel="nofollow">black-forest-labs/FLUX.1-dev</a> that takes 10 seconds to complete on a GPU machine that costs $0.00012 per second to run, will be billed $0.0012.</p> <p data-svelte-h="svelte-o2p8qd">The <code>&quot;hf-inference&quot;</code> provider is currently the default provider when working with the JavaScript and Python SDKs. Note that this default might change in the future.</p> <h2 class="relative group"><a id="billing-for-team-and-enterprise-organizations" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#billing-for-team-and-enterprise-organizations"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Billing for Team and Enterprise organizations</span></h2> <p data-svelte-h="svelte-tvaw01">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 <code>&quot;X-HF-Bill-To: my-org-name&quot;</code> as a header in your HTTP requests.</p> <p data-svelte-h="svelte-1r9q8ej">Enterprise Hub organizations receive a pool of free usage credits based on the number of seats in the subscription. Inference Providers usage can be tracked on the organization’s billing page. Enterprise Hub organization administrators can also set a spending limit and disable a set of Inference Providers from the organization’s settings.</p> <div class="flex justify-center" data-svelte-h="svelte-inql4"><img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/enterprise-org-settings-light.png"> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/enterprise-org-settings-dark.png"></div> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">huggingface_hub </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">openai </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">requests </div></div> <div class="language-select"><p data-svelte-h="svelte-17awpj8">To bill your organization, use the <code>bill_to</code> parameter when initializing the client.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient
client = InferenceClient(bill_to=<span class="hljs-string">&quot;my-org-name&quot;</span>)
completion = client.chat.completions.create(
model=<span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
messages=[
{
<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>
}
],
)
<span class="hljs-built_in">print</span>(completion.choices[<span class="hljs-number">0</span>].message)<!-- HTML_TAG_END --></pre></div> </div> <p data-svelte-h="svelte-1au2dst">Similarily in JavaScript:</p> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">huggingface.js </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">openai </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">fetch </div></div> <div class="language-select"><p data-svelte-h="svelte-11uymxv">If you are using the JavaScript <code>InferenceClient</code>, you can set the <code>billTo</code> attribute at a client level to bill your organization.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> { <span class="hljs-title class_">InferenceClient</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;@huggingface/inference&quot;</span>;
<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">InferenceClient</span>(process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>, { <span class="hljs-attr">billTo</span>: <span class="hljs-string">&quot;my-org-name&quot;</span> });
<span class="hljs-keyword">const</span> completion = <span class="hljs-keyword">await</span> client.<span class="hljs-property">chat</span>.<span class="hljs-property">completions</span>.<span class="hljs-title function_">create</span>({
<span class="hljs-attr">model</span>: <span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
<span class="hljs-attr">messages</span>: [
{
<span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-attr">content</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>,
},
],
});
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(completion.<span class="hljs-property">choices</span>[<span class="hljs-number">0</span>].<span class="hljs-property">message</span>.<span class="hljs-property">content</span>);<!-- HTML_TAG_END --></pre></div> </div> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/hub-docs/blob/main/docs/inference-providers/pricing.md" target="_blank"><span data-svelte-h="svelte-1kd6by1">&lt;</span> <span data-svelte-h="svelte-x0xyl0">&gt;</span> <span data-svelte-h="svelte-1dajgef"><span class="underline ml-1.5">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_tpxpzz = {
assets: "/docs/inference-providers/pr_1821/en",
base: "/docs/inference-providers/pr_1821/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/inference-providers/pr_1821/en/_app/immutable/entry/start.652aa0ea.js"),
import("/docs/inference-providers/pr_1821/en/_app/immutable/entry/app.8c7cd661.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 7],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
30.2 kB
·
Xet hash:
57cc6ebd97987bc2f01ffb67e2c39b34bc84cb23ae20155d94cc673e28765953

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.