Skip to content
mentoor

Keys and per-user limits

For engineers

Keeping provider keys on the server, rotating and scoping them, enforcing per-user quotas and spotting abuse of your AI endpoint

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

A web app calls the model provider straight from the browser using a key stored in a build-time variable. What is the core problem?

Choose one answer

Check yourself · 2 of 5

You are rotating a production key with no downtime. What is the right order?

Choose one answer

Check yourself · 3 of 5

Why count tokens per user instead of only counting requests?

Choose one answer

Check yourself · 4 of 5

A usage log shows one new account making 3,000 calls at an even two-second interval with large inputs. Which pattern is this?

Choose one answer

Check yourself · 5 of 5

You move the provider call into a server route and keep the key in the server environment. Which step is still missing?

Choose one answer

Topics

  1. Keeping provider keys on the server4 min read · Why keys never ship in browser or mobile bundles, server proxy routes and short-lived tokens for realtime clients
  2. Rotating, scoping and revoking API keys4 min read · Separate keys per environment and service, secret managers, zero-downtime rotation and what to do when a key leaks
  3. Enforcing per-user quotas and spend caps5 min read · Token and request budgets per user and plan, workspace spend limits and clear messages when a quota is reached
  4. Detecting abuse of an LLM endpoint5 min read · Free-tier farming, use as a free model proxy, wallet-draining loops and injection probes in usage logs

Start here

Helps to know first

110 questions · last verified 2026-12