Limit requests to AI generation endpoints

A single visitor can submit a generation request more often than your interface suggests. Treat the generation endpoint as a metered operation and keep the prompt outside the protection policy.

A small lens and curved orange frame sit in front of a stack of browser-shaped sheets.
POST /api/generateThe application route that calls the model provider

Overlapping model jobs

Session evidence

If one session starts several jobs, compare the request times with model job IDs in your service. Check the route for each call so that polling for an answer is counted separately.

Oraami AI assessment

Oraami AI assesses matched browser behavior in eligible cases. The case can be investigated using that evidence while your application handles prompt content and model safety.

How automatic case decisions work

Policy response

If you limit the generation endpoint, a request above the session allowance receives HTTP 429 before the model call. Visitors can still check existing jobs on a separate, unrestricted status route.

Setup requirements

Connect the browser tracker to collect session evidence under your site’s capture settings. A workspace owner can enable automatic case decisions for the site. To apply a route policy, connect a Cloudflare Worker or Node middleware and enable the policy on the relevant route.

How to set it up

  1. Identify the expensive operation

    Protect the submission that starts a completion or an image job. Keep reading existing results and checking job status on separate routes.

  2. Apply a submission window

    Choose a method and route in the enabled protection policy. Requests over the linked session’s allowance receive a retry interval before your application invokes the provider.

  3. Keep your model controls

    The request limit works with route metadata. Your application remains responsible for prompt safety, model authorization, token budgets and account-wide quotas.

Verify the result

Use a test model endpoint to confirm that an over-limit request produces a receipt without an extra model call. Inspect application telemetry to measure the resulting usage.