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 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": "llama3.1-8b",
"messages": [
{
"role": "user",
"content": "What is Cloudflare?"
}
]
}'你也可以通过 REST API 使用 OpenAI API schema 访问 Cerebras 模型。将请求发送至:
https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/chat/completions指定:
{
"model": "cerebras/{model}"
}