LogoToRouter Docs
LogoToRouter Docs
HomepageWhat is ToRouter5-minute quickstartCore concepts
Create your first API keyIP whitelist & blacklist (CIDR)Quota, rate limits & expirationRestrict which models a key can callRotate or revoke a key
API Keys

Quota, rate limits & expiration

Cap per-key spend in USD, throttle requests per window, and auto-expire keys after N days.

Every ToRouter key carries three independent guardrails. They are combined with the plan-side limits on your account — whichever is stricter applies first.

Spend cap (USD)

A hard ceiling on how much this key may consume in USD.

  • No extra cap — leave the default or set 0 to follow your plan-side allowance without a key-specific ceiling.
  • Positive number — once spend reaches this amount, new requests are rejected.

When exhausted the key returns 402 (insufficient quota or balance). Top up or raise the relevant limits in the portal.

Request rate (sliding windows)

Three independent sliding windows count requests. A call is allowed only when all enabled windows still have headroom.

  • Roughly 5 hours — dampens short bursts.
  • Roughly 24 hours — day-level pacing for an integration.
  • Roughly 7 days — weekly budget for a shared key.

Set 0 on a window to turn that window off. Hitting a window returns 429 — see Rate limited.

Auto-expiry

You can disable a key automatically after N days from creation:

  • 0 — never expires (default).
  • 30 — expires about 30 days after creation.

Expired keys return 401. Create a new key to continue (see Rotate).

Limits are evaluated before the upstream call, so blocked requests cost nothing.

Editing limits

API Keys → click the key → Edit → save. Changes take effect on the next request.

Next steps

IP restrictions

Pair quotas with network rules.

Usage dashboard

Watch spend and trends.

IP whitelist & blacklist (CIDR)

Restrict a ToRouter API key to known networks using CIDR rules. Supports IPv4 and IPv6.

Restrict which models a key can call

Limit a ToRouter API key to a specific list of model IDs. Inherits the group catalog when empty.

Table of Contents

Spend cap (USD)Request rate (sliding windows)Auto-expiryEditing limitsNext steps