Skip to content

Key quota, expiration, and IP restrictions

Set clear limits for shared devices, automated tasks, or temporary use, to prevent keys from being abused and to avoid financial loss.

Three supported restrictions

Restriction typeEffectUse case
Quota limitAutomatically disables the key once its total consumption reaches the capSet a budget for friends/shared devices
Rate limitLimits the number of requests per minute/hourPrevent scripts from calling excessively
Expiration timeAutomatically becomes invalid upon expiryTemporary tasks, trials

How to set restrictions

When creating a key, or by clicking the edit button for the key on the "API Keys" page:

  1. Quota limit: enter a USD quota or a token cap
  2. Rate limits: fill in the time window and the maximum number of requests
  3. Expiration time: choose a date; the key is automatically disabled when it expires

IP restrictions (if the site owner enables them)

Some sites let you set an IP allowlist/denylist for a key:

  • IP allowlist: only IPs on the list can make requests; all others are rejected
  • IP denylist: IPs on the list are rejected; all others are allowed

TIP

  • Office network IPs can change, so confirm your outbound IP before setting an allowlist
  • Using a proxy/VPN changes your outbound IP and may cause requests to fail
  • If IP restrictions are silently cleared when you edit a key (an issue in older versions), check and set them again

What happens when a limit runs out

  • Returns 429 (rate limit exceeded) or 403/insufficient balance (quota used up)
  • The key does not recover automatically; you need to adjust the limits or wait for it to expire and then recreate it
ScenarioSuggested configuration
Your primary machineNo limits or a high quota + no expiration
Sharing with friendsQuota $5 + rate 60/min + no expiration
Temporary automation tasksQuota $1 + rate 30/min + 7-day expiration
Server with a fixed IPAdding an IP allowlist is more secure

Ready to get started?

Sign up and get $0.30 in trial credit; usage is billed per token in real time, so you pay only for what you use.

Sign up freeSee model pricing

For lawful and compliant use only. Please follow our Terms of Service and your local laws and regulations.