Stops upon credit exhaustion · PRO tier $9/mo includes $2.00 monthly quota
https://router.huggingface.co/v1 💡 Directly paste the address above as Base URL into any OpenAI-compatible client (NextChat, Cherry Studio, Immersive Translate, etc.).
meta-llama/Llama-3.3-70B-Instruct meta-llama/Llama-3.1-8B-Instruct Qwen/Qwen2.5-72B-Instruct deepseek-ai/DeepSeek-R1 Hugging Face Inference Providers(推断提供商)是 Hugging Face 官方全新推出的统一模型推理网关。它摒弃了过去老版 Serverless 经常冷启动和排队的缺陷,深度聚合了 Groq、Cerebras、DeepInfra、Fireworks、Together、Novita、Sambanova 等全球 14 大高性能推理云服务商。
平台为所有注册用户每月免费提供 $0.10 美元的推理额度(每月 1 日自动重置),如果订阅 PRO 会员($9/月)则每月包含 $2.00 额度。由于聚合云中的 Llama 3.1 8B 等模型费率低至 $0.05/1M tokens,免费用户的 $0.10 额度足以跑完约 200 万 Tokens 的测试量!此外,HF Spaces 还为所有用户提供每日 ZeroGPU 免费算力(免费用户 5~60 分钟/天,PRO 用户 40~240 分钟/天),免绑卡零门槛享受。
Always use the recommended endpoint `https://router.huggingface.co/v1`, fully compatible with OpenAI SDK. The legacy `api-inference.huggingface.co` endpoint suffers from cold starts and lacks multi-provider dynamic routing.
Every registered user receives $0.10 in credits on the 1st of each month with no card required, supporting 200+ open-weight models (~2M tokens on Llama 8B), perfect for lightweight experiments.
OPTIONS preflight responses return `access-control-allow-origin: *`, enabling direct client-side web browser invocation without intermediate proxy servers.
Sign up with email only—no credit card or phone number required. Credit exhaustion responds with HTTP 402 or 429 without unexpected auto-billing.
Beyond API credits, HF Spaces grants 5 to 60 minutes/day of free ZeroGPU compute to test Gradio/Streamlit deep learning demos directly in browser.
Visit huggingface.co and create a free account using only your email address.
Go to Console ↗Navigate to Settings -> Access Tokens, click 'Create new token', and select 'Read' scope.
Go to Console ↗Set Base URL to https://router.huggingface.co/v1 with your hf_ token in any OpenAI-compatible client to access 200+ open-source models immediately!
from openai import OpenAI
client = OpenAI(
api_key="your_api_key_here", # 填入申请的 Key
base_url="https://router.huggingface.co/v1"
)
response = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=[
[object Object]
]
)
print(response.choices[0].message.content)