跳转到内容
搜索文档

Replicate

最后更新 查看 MarkdownAgent 设置

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 Gateway Account ID。
  • 你的 AI Gateway gateway 名称。
  • 有效的 Replicate API 令牌。你可以在 replicate.com/account/api-tokens 创建一个
  • 要使用的 Replicate 模型名称,例如 anthropic/claude-4.5-haikugoogle/nano-banana

示例

cURL

Requestbash
curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/replicate/predictions \
  --header 'Authorization: Bearer {replicate_api_token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "version": "anthropic/claude-4.5-haiku",
    "input":
      {
        "prompt": "Write a haiku about Cloudflare"
      }
    }'

这篇文档对您有帮助吗?