RunbaseDocs

Command Palette

Search for a command to run...

Rate Limits

API request limits and how to handle them.

Runbase applies rate limits per API key to ensure fair usage and platform stability.

Default limits

ScopeLimit
API key (runs endpoints)20 requests per 10 seconds
Auth endpoints5 requests per 60 seconds
Session check60 requests per 60 seconds

The rate limit for runs endpoints applies to both POST /api/v1/runs and GET /api/v1/runs/:id combined, per API key.

Rate limit response

When you exceed the limit, the API returns HTTP 429:

{
  "error": {
    "message": "Rate limit exceeded",
    "code": "RATE_LIMITED"
  }
}

Handling rate limits

Implement exponential backoff when you receive a 429 response:

import time
import requests
 
def create_run(api_key, model, input_data, max_retries=3):
    url = "https://runbase.net/api/v1/runs"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    body = {"model": model, "input": input_data}
 
    for attempt in range(max_retries):
        response = requests.post(url, json=body, headers=headers)
        if response.status_code == 429:
            wait = 2 ** attempt
            time.sleep(wait)
            continue
        return response.json()
 
    raise Exception("Rate limit exceeded after retries")

Tips

  • Use separate keys for different services or workers to avoid sharing a rate limit
  • Poll with reasonable intervals when checking run status — every 1–2 seconds is sufficient for most models
  • Batch work rather than sending many requests simultaneously
  • Don't retry immediately on 429 — always wait before retrying

Need higher limits?

Contact support@runbase.net if your use case requires higher rate limits.