Make my first API call
7 days · 1,000,000 tokens per day shared across all trial models · no credit card
The catalog is temporarily unavailable. Please try again shortly.
Does your application use the Anthropic SDK or Messages protocol? Follow the dedicated guide with a compatible, authorized model. Claude Messages API with RouterLab
1. Activate your trial and create a key
Register, verify your email and open API keys. Create a key and copy it when it is shown. Check the model in GET /v1/models using this key.
2. Install the Python SDK
Prerequisite: Python 3.10 or newer. Use python or python3 depending on your installation.
Python SDK shell
python -m pip install openai3. Set the key for this session
Replace the quoted value with your key. Keep it private and outside your repository. Choose the command for your terminal.
macOS / Linux shell
export ROUTERLAB_API_KEY="YOUR_ROUTERLAB_API_KEY"Windows PowerShell powershell
$env:ROUTERLAB_API_KEY="YOUR_ROUTERLAB_API_KEY"4. Save and run the script
Copy the full script into routerlab_first_call.py and run python routerlab_first_call.py. A text response appears in your terminal; its contents may vary. This script uses Chat Completions.
Reproduce a 1,000-request budget using catalog rates
If the call fails
- 401 / AuthenticationError
- Check ROUTERLAB_API_KEY in the same terminal as your script, your active key, and https://api.uncsr.ch/v1.
- 403 / PermissionDeniedError
- List GET /v1/models with this key. Choose an authorized -trial variant. Production routes may be denied. Check your trial expiry date.
- 429 / RateLimitError
- All keys and models share the account quota. Check your budget and next reset in your dashboard. Wait if you hit a rate limit.
- 400 / 404
- Copy the exact authorized model ID and use its indicated protocol. Claude Messages and image models do not use this chat example.