跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com

Cerebras

最后更新 查看 MarkdownAgent 设置

Cerebras ↗ 为开发者提供低延迟的 AI 模型推理解决方案。

端点

https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/cerebras

前提条件

向 Cerebras 发送请求时,请确保具备以下条件:

  • 你的 AI Gateway Account ID。
  • 你的 AI Gateway gateway 名称。
  • 有效的 Cerebras API 令牌。
  • 要使用的 Cerebras 模型名称。

示例

cURL

Example fetch requestbash
curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/cerebras/chat/completions \
 --header 'content-type: application/json' \
 --header 'Authorization: Bearer CEREBRAS_TOKEN' \
 --data '{
    "model": "gpt-oss-120b",
    "messages": [
        {
            "role": "user",
            "content": "What is Cloudflare?"
        }
    ]
}'

OpenAI 兼容端点

你也可以通过 REST API 使用 OpenAI API schema 访问 Cerebras 模型。将请求发送至:

https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/chat/completions

指定:


{
"model": "cerebras/{model}"
}

这篇文档对您有帮助吗?