Skip to content

Guard Workers AI calls with the shared daily neuron budget #62

Description

@sarthakagrawal927

Cloudflare Workers AI calls need admission through the shared free-ai-gateway budget before each provider attempt. Add the existing NEURON_BUDGET binding to this Worker and guard every Workers AI binding call with conservative UTF-8 input reservations, a bounded output-token limit, strict current-day receipts, and fail-closed behavior. Preserve BYOK and do not add provider fallback on budget denial. Validate retries reserve separately and malformed/exhausted budgets make zero inference calls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions