Legacy TinyLimiter documentation. About this product
Add rate limiting to your API in minutes. No infrastructure to manage.
1. Get Your API Key
- Sign up at dashboard.tinyscale.io
- Navigate to API Keys
- Click Create Key → Select TinyLimiter → Choose Test mode
- Copy your key (it starts with
ts_limiter_test_)
2. Make Your First Request
curl -X POST https://limiter.tinyscale.io/v1/check \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"namespace": "api",
"identifier": "user_123",
"limit": 10,
"window": 60000
}'
Response:
{
"data": {
"allowed": true,
"remaining": 9,
"limit": 10,
"reset_at": 1703980800000,
"namespace": "api",
"identifier": "user_123"
}
}
3. Integrate Into Your App
async function checkRateLimit(userId) {
const response = await fetch('https://limiter.tinyscale.io/v1/check', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.TINYSCALE_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
namespace: 'api',
identifier: userId,
limit: 100,
window: 60000,
}),
});
const { data } = await response.json();
return data.allowed;
}
// Usage in your route handler
app.get('/api/resource', async (req, res) => {
const allowed = await checkRateLimit(req.user.id);
if (!allowed) {
return res.status(429).json({ error: 'Too many requests' });
}
// Process request...
});
What's Next?
- Authentication - Learn about API key modes and formats
- API Reference - Full endpoint documentation
- Error Codes - Handle errors gracefully