Help Center / api
Managing API keys
Managing API Keys
API keys authenticate your applications with our API. Learn how to create and manage them securely.
Creating an API Key
- Go to Settings > API Keys
- Click Create New Key
- Enter a descriptive name
- Select permissions:
- Read - View resources only
- Write - Create and modify resources
- Delete - Remove resources
- Set IP restrictions (optional but recommended)
- Click Create
- Copy the key immediately - it won't be shown again!
Key Format
API keys look like this:
osir_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Parts:
osir_- Prefix identifying our APIlive_ortest_- Environment- Random string - Unique identifier
Using Your API Key
In Headers (Recommended)
curl -H "Authorization: Bearer osir_live_xxx" \
https://api.osir.com/v1/domains
In Query String (Not Recommended)
https://api.osir.com/v1/domains?api_key=osir_live_xxx
Test vs Live Keys
| Key Type | Purpose | Real Charges |
|---|---|---|
| Test | Development & testing | No |
| Live | Production | Yes |
Always use test keys during development!
IP Restrictions
Limit key usage to specific IPs:
- Edit your API key
- Add allowed IP addresses
- Save changes
Example:
192.168.1.100- Single IP192.168.1.0/24- IP range
Key Permissions
| Permission | Allowed Actions |
|---|---|
| domains:read | List, view domains |
| domains:write | Register, modify domains |
| vps:read | List, view servers |
| vps:write | Create, modify servers |
| billing:read | View invoices, balance |
| billing:write | Add payment methods |
Revoking Keys
If a key is compromised:
- Go to API Keys
- Find the key
- Click Revoke
- Key is immediately invalidated
Best Practices
- One key per application - Easier to revoke if needed
- Use IP restrictions - Limit exposure
- Rotate regularly - Create new keys, revoke old ones
- Never commit keys - Use environment variables
- Monitor usage - Check API logs for unusual activity
Environment Variables
Store keys securely:
# .env file (never commit!)
OSIR_API_KEY=osir_live_xxx
// Use in code
const apiKey = process.env.OSIR_API_KEY