ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Feature Request]: Cloudflare AI Gateway Support

Open centminmod opened this issue 9 months ago • 0 comments

Is there an existing issue for the same feature request?

  • [x] I have checked the existing issues.

Is your feature request related to a problem?


Describe the feature you'd like

Hi I use OpenRouter AI API via Cloudflare AI Gateway proxy for prompt request caching https://developers.cloudflare.com/ai-gateway/providers/openrouter/.

This usually means I need to pass a Cloudflare AI Gateway authentication header https://developers.cloudflare.com/ai-gateway/configuration/authentication/ along with the OpenRouter AI API key.

curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/openai/chat/completions \
  --header 'cf-aig-authorization: Bearer {CF_AIG_TOKEN}' \
  --header 'Authorization: Bearer OPENAI_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "What is Cloudflare?"}]}'

But Ragflow doesn't currently support passing additional headers for such Cloudflare AI Gateway authentication. Would be nice if you add such a feature 😃

Example Cloudflare AI Gateway analytics for Openrouter AI API usage

Image

Describe implementation you've considered

No response

Documentation, adoption, use case


Additional information

No response

centminmod avatar Mar 02 '25 22:03 centminmod