Skip to content

Elaboration on proxy geolocation #24829

@JoshuaKirby88

Description

@JoshuaKirby88

Proposed changes

Some APIs (e.g. Google’s Gemini API through Google AI Studio) enforce geo-restrictions. Since Cloudflare AI Gateway proxies requests, it is important to clarify where these requests originate from geographically.

Proposed changes
Add documentation that specifies one of the following:

  • Proxied requests originate from a Cloudflare Worker within close proximity to the invoker.
  • Proxied requests originate from a Durable Object within close proximity to the invoker.
  • Cloudflare guarantees that proxied requests always originate from a non-restricted location.

Context

  • I have not yet encountered geo-restriction errors when using Gemini API through AI Gateway.
  • However, I have encountered such errors in the past when calling Gemini API directly.
  • To work around this, I currently:
    • Disable smart placement of my Workers.
    • Proxy Gemini API requests through a Durable Object (since these seem to originate from major, supported regions).
    • Retry from a Durable Object in another location on error.

Subject Matter

Clarify where proxied requests originate from and how this is determined.

Content Location

  • If configurable: ai-gateway/configuration/request-location.mdx
  • If not configurable: ai-gateway/features/request-location.mdx

Additional information

No response

Metadata

Metadata

Labels

content:newRequest for new/missing contentdocumentationDocumentation edits

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions