Skip to content
Cloudflare Docs
非官方翻译 - 此文档为非官方中文翻译版本,仅供参考。如有疑问请以 英文官方文档 为准。

Replicate

Replicate 运行和微调开源模型。

端点

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

URL 结构

在向 Replicate 发出请求时,将您当前使用的 URL 中的 https://api.replicate.com/v1 替换为 https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/replicate

前提条件

在向 Replicate 发出请求时,确保您具有以下内容:

  • 您的 AI 网关账户 ID。
  • 您的 AI 网关网关名称。
  • 一个有效的 Replicate API 令牌。
  • 您要使用的 Replicate 模型的名称。

示例

cURL

请求
curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/replicate/predictions \
--header 'Authorization: Token {replicate_api_token}' \
--header 'Content-Type: application/json' \
--data '{
"input":
{
"prompt": "What is Cloudflare?"
}
}'