Install
openclaw skills install model-rate-limit-recoveryDiagnose and recover from model rate limit errors (ChatGPT usage limits, 429 errors). Use when cron jobs or agent sessions fail with "Try again in ~9500 min" or similar rate limit messages. Covers API key rotation, model fallback, and manual recovery procedures.
openclaw skills install model-rate-limit-recovery# Check cron job runs
openclaw cron runs --jobId <job_id>
# Look for error messages containing:
# - "usage limit"
# - "Try again in ~"
# - "429"
# - "rate_limit"
# - "quota"
# - "resource exhausted"
# Check current model configuration
openclaw status | grep -A5 "Model"
# Check environment for API keys
env | grep -i "OPENAI\|ANTHROPIC\|DEEPSEEK"
Common causes:
# 1. Run failed task manually with alternative model
openclaw sessions spawn \
--task "Your task here" \
--model "deepseek/deepseek-chat" \
--label "Manual recovery"
# 2. Update cron job to specify model
openclaw cron update --jobId <job_id> --patch '{
"payload": {
"kind": "agentTurn",
"message": "...",
"model": "deepseek/deepseek-chat",
"timeoutSeconds": 180
}
}'
# Add multiple API keys for rotation
export OPENAI_API_KEYS="key1,key2,key3"
export OPENAI_API_KEY_1="sk-..."
export OPENAI_API_KEY_2="sk-..."
export OPENCLAW_LIVE_OPENAI_KEY="sk-..." # Highest priority
# OpenClaw will automatically rotate through keys on rate limits
# 429, rate_limit, quota, resource exhausted → tries next key
# Other failures → fails immediately
{
"agents": {
"defaults": {
"model": {
"primary": "openai-codex/gpt-5.4",
"fallback": "deepseek/deepseek-chat"
},
"models": {
"openai-codex/gpt-5.4": {
"params": {
"maxRetries": 2,
"retryOnRateLimit": true
}
}
}
}
}
}
{
"name": "Resilient Scheduled Task",
"schedule": {
"kind": "cron",
"expr": "0 * * * *",
"tz": "Africa/Johannesburg"
},
"payload": {
"kind": "agentTurn",
"message": "Task instructions...",
"model": "deepseek/deepseek-chat", // Specify model explicitly
"timeoutSeconds": 300 // Set reasonable timeout
},
"sessionTarget": "isolated",
"delivery": {
"mode": "announce"
}
}
openai-codex/gpt-5.4 (when available)deepseek/deepseek-chat (no usage limits)anthropic/claude-sonnet-4-6 (if available)model in payloadtimeoutSecondsdeleteAfterRun: true for one-shot tasksdelivery.mode: "announce" for notifications# Regular cron job health checks
openclaw cron list
openclaw cron runs --jobId <job_id> --limit 5
# Check for recent failures
grep -i "usage limit\|429\|rate_limit" /tmp/openclaw/openclaw-*.log
# Create recovery script
cat > /root/.openclaw/workspace/scripts/recover-failed-cron.sh <<'EOF'
#!/bin/bash
JOB_ID="$1"
NEW_MODEL="${2:-deepseek/deepseek-chat}"
# Get failed runs
FAILED_RUNS=$(openclaw cron runs --jobId "$JOB_ID" | grep -c "status.*error")
if [ "$FAILED_RUNS" -gt 0 ]; then
echo "Recovering $FAILED_RUNS failed runs for job $JOB_ID"
openclaw cron update --jobId "$JOB_ID" --patch "{\"payload\":{\"model\":\"$NEW_MODEL\"}}"
openclaw cron run --jobId "$JOB_ID"
fi
EOF
chmod +x /root/.openclaw/workspace/scripts/recover-failed-cron.sh
See scripts/resilient-cron-template.json
See references/model-fallback-config.json
See scripts/recover-failed-cron.sh