We’re on a journey to advance and democratize artificial intelligence through open source and open science.

计费方式

按量计费

价格区间

注册方式

最后更新:2026-03-16

如何接入 Hugging Face

Hugging Face 接口完全兼容 OpenAI API 格式。只需将 base_url 替换为中转站地址,即可在任何支持自定义 API 端点的客户端或代码中使用。

from openai import OpenAI

client = OpenAI(
    api_key="你的 Hugging Face API Key",
    base_url="https://huggingface.co/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "你好"}]
)
print(response.choices[0].message.content)

常见问题

Hugging Face 支持哪些模型?

支持多种主流 AI 模型,具体以官网为准。

Hugging Face 价格如何?

采用按量计费模式,具体价格请查看官网价格页面。

国内可以直接访问 Hugging Face 吗?

Hugging Face 提供 API 中转服务,国内用户可直接调用其 API 接口,无需自行翻墙。