Skip to content

feat: monitor AI Gateway upstream-provider cost (aiGatewayRequestsAdaptiveGroups) #18

Description

@mikeumus

Priority: HIGH for anyone using AI Gateway as an LLM proxy.

aiGatewayRequestsAdaptiveGroups has a sum.cost that attributes upstream provider cost (OpenAI/Anthropic/Gemini/Vertex) for traffic routed through AI Gateway — external LLM spend that neither Workers AI Neurons nor the CF bill can see.

  • dimensions: gateway, provider, model, cached, error, rateLimited, statusCode
  • sum: cost, erroredRequests, cachedRequests, uncachedTokensIn/Out, cachedTokensIn/Out
  • Gotcha: cost is $0 for the workers-ai provider (Neurons bills that separately) — combine with the Neurons monitor to avoid double-counting and blind spots.

Reference implementation (built + running in prod at Divinci): Divinci-AI/cloudflare-billing-kill-switch.
From FEEDBACK-from-divinci-deployment.md — real-world findings from the Divinci self-hosted deployment, 2026-06-17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cloudflareCloudflare datasets / API integrationarea:llm-costLLM/AI inference spend monitoringenhancementNew feature or requestpriority:highCritical — outage risk or biggest coverage gap

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions