这个资源提供什么What this offer provides
The official Inference Providers documentation states: 'Get Started for Free: Inference Providers includes a generous free tier, with additional credits for PRO users and Team & Enterprise organizations.'The official Inference Providers documentation states: 'Get Started for Free: Inference Providers includes a generous free tier, with additional credits for PRO users and Team & Enterprise organizations.'
关键信息Key details
快速上手Quick start
Call open models through the Inference Providers router with the free tier included in every accountFollow the model-specific steps to register, create a key and connect the model.
注册与接入步骤Registration and access steps
准备条件Prerequisites
- Hugging Face account
- Hugging Face access token
- Create a Hugging Face account and generate an access tokenCreate a Hugging Face account and generate an access token
- Send an OpenAI-compatible chat completion request to the router endpoint within the free monthly creditsSend an OpenAI-compatible chat completion request to the router endpoint within the free monthly credits
发送第一条请求Send first request
使用下方命令开始调用。Use the command below to make your first request.
export HF_TOKEN="你的 Key"
curl https://router.huggingface.co/v1/chat/completions --header "Authorization: Bearer $HF_TOKEN" --header 'Content-Type: application/json' --data '{"model":"openai/gpt-oss-120b","messages":[{"role":"user","content":"Hello"}]}'如何使用How to use
Call open models through the Inference Providers router with the free tier included in every accountCall open models through the Inference Providers router with the free tier included in every account
前置条件Prerequisites
- Hugging Face accountHugging Face account
- Hugging Face access tokenHugging Face access token
步骤Steps
- Create a Hugging Face account and generate an access tokenCreate a Hugging Face account and generate an access token
- Send an OpenAI-compatible chat completion request to the router endpoint within the free monthly creditsSend an OpenAI-compatible chat completion request to the router endpoint within the free monthly credits
官方来源Official sources
Official docs: 'Get Started for Free: Inference Providers includes a generous free tier, with additional credits for PRO users and Team & Enterprise organizations.'Official docs: 'Get Started for Free: Inference Providers includes a generous free tier, with additional credits for PRO users and Team & Enterprise organizations.'