← MarketplaceGet started free
Guide

Rate Limiting on AI Agent APIs: How It Works

Rate Limits on Runcept

Every API key has a per-minute rate limit based on your plan:

PlanRequests/min

|------|-------------|

Free10 Starter30 Pro100 Agent100

Rate limits apply to POST /api/v1/run (job creation). Polling GET /api/v1/jobs/:id does not count against your rate limit.

The 429 Response

When you exceed your rate limit, Runcept returns:

HTTP/1.1 429 Too Many Requests

Retry-After: 60

Content-Type: application/json

{ "error": "rate_limit_exceeded", "retry_after": 60 }

Handling 429 in JavaScript

async function runAgentWithRetry(slug, input, maxRetries = 3) {

for (let attempt = 0; attempt < maxRetries; attempt++) {

const response = await fetch('https://www.runcept.com/api/v1/run', {

method: 'POST',

headers: {

Authorization: Bearer ${process.env.RUNCEPT_API_KEY},

'Content-Type': 'application/json',

},

body: JSON.stringify({ agent: slug, input }),

})

if (response.status === 429) {

const retryAfter = parseInt(response.headers.get('Retry-After') ?? '60')

console.warn(Rate limited. Waiting ${retryAfter}s...)

await new Promise(r => setTimeout(r, retryAfter * 1000))

continue

}

return response.json()

}

throw new Error('Max retries exceeded')

}

Handling 429 in Python

import time

import requests

def run_agent_with_retry(slug, input_data, max_retries=3):

url = "https://www.runcept.com/api/v1/run"

headers = {"Authorization": f"Bearer {os.environ['RUNCEPT_API_KEY']}"}

for attempt in range(max_retries):

r = requests.post(url, headers=headers, json={"agent": slug, "input": input_data})

if r.status_code == 429:

retry_after = int(r.headers.get("Retry-After", 60))

print(f"Rate limited. Waiting {retry_after}s...")

time.sleep(retry_after)

continue

r.raise_for_status()

return r.json()

raise RuntimeError("Max retries exceeded")

Batch Processing Strategy

If you need to process many items, stagger your requests:

async function processBatch(items, agentSlug, ratePerMin = 10) {

const delayMs = (60 / ratePerMin) * 1000 // spread over a minute

const results = []

for (const item of items) {

const result = await runAgent(agentSlug, item)

results.push(result)

await new Promise(r => setTimeout(r, delayMs))

}

return results

}

Next Steps

  • Upgrade your plan for higher rate limits
  • Node.js guide
  • Python guide
  • Related guides

    Call an AI Agent API from Node.jsCall an AI Agent API from PythonRun an AI Agent from GitHub ActionsHow to Monetize an AI Agent as an API