Replicate ↗ 运行和微调开源模型。
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/replicate向 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-haiku或google/nano-banana。
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"
}
}'