Skip to content
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

[InferenceClient] Support billTo header #1297

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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 added 3 commits March 19, 2025 18:05

Verified

This commit was signed with the committer’s verified signature.
Wauplin Lucain

Verified

This commit was signed with the committer’s verified signature.
Wauplin Lucain

Verified

This commit was signed with the committer’s verified signature.
Wauplin Lucain

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.

None yet

4 participants