Skip to content

[InferenceClient] Support billTo header #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 28, 2025
Merged

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Mar 19, 2025

Related to huggingface/huggingface_hub#2940. Discussed in DMs (private link)

Basically adds a parameter allowing a user to be charge all their requests on their organization account instead of personal account.

PR to merge only once "X-HF-Bill-To" header is supported server side cc @SBrandeis

import { InferenceClient } from "@huggingface/inference";

const client = new InferenceClient("hf_token", { billTo: "huggingface" });

const image = await client.textToImage({
	model: "black-forest-labs/FLUX.1-schnell",
	inputs: "A majestic lion in a fantasy forest",
	provider: "fal-ai",
});
/// Use the generated image (it's a Blob)

@Wauplin
Copy link
Contributor Author

Wauplin commented Mar 28, 2025

Following server-side update and @SBrandeis 's confirmation that backend is ready, let's merge!

@Wauplin Wauplin merged commit a74e4ee into main Mar 28, 2025
5 checks passed
@Wauplin Wauplin deleted the support-bill-to-header branch March 28, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants