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

Create your first API key

Generate a ToRouter API key from the portal and use it with any OpenAI-, Anthropic- or Gemini-compatible SDK.

An API key authenticates every request you send to ToRouter. Keys are scoped to your account and inherit limits from the group you have subscribed to.

Open the API Keys page

Go to portal.torouter.ai → API Keys in the sidebar. You must be signed in with a verified email.

Click "Create key"

Give the key a name you'll recognise (e.g. cursor-laptop, prod-backend). Optional fields:

  • Quota — USD spend cap for this key (0 = unlimited within group quota)
  • Expires in days — auto-disable after N days (0 = no expiry)
  • Rate limits — requests per 5 hours / 1 day / 7 days
  • IP whitelist / blacklist — CIDR rules (see IP restrictions)
  • Model whitelist — comma-separated model IDs (see Model whitelist)

All limits can be edited later. Leave them empty to inherit your group's defaults.

Copy the key

The full key is shown once. It looks like sk-***. Paste it into your password manager or .env file immediately.

ToRouter never displays the key plaintext again — only the first/last few characters. If you lose it, rotate it.

Make a request

test.sh
curl https://portal.torouter.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-***" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5","messages":[{"role":"user","content":"hi"}]}'

A 200 response means the key works. Errors? See Troubleshooting.

Next steps

Base URL & authentication

The endpoint table for every SDK.

Quota & rate limits

Cap spend and request volume per key.

Rotate or revoke

Replace a compromised key.

Reset forgotten password

Get back into your account by requesting a password reset link by email.

IP whitelist & blacklist (CIDR)

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

Table of Contents

Open the API Keys pageClick "Create key"Copy the keyMake a requestNext steps