anth-common-errors

Featured

Diagnose and fix Anthropic Claude API errors by HTTP status code. Use when encountering API errors, debugging failed requests, or troubleshooting authentication, rate limiting, or input validation issues. Trigger with phrases like "anthropic error", "claude api error", "fix anthropic 429", "claude not working", "debug claude api".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Common Errors ## Overview Quick reference for all Claude API error types with exact HTTP codes, error bodies, and fixes. The API returns errors as JSON: `{"type": "error", "error": {"type": "...", "message": "..."}}`. ## Error Reference ### 400 — `invalid_request_error` ```json {"type": "error", "error": {"type": "invalid_request_error", "message": "messages: roles must alternate between \"user\" and \"assistant\""}} ``` **Common causes and fixes:** | Message Pattern | Cause | Fix | |----------------|-------|-----| | `messages: roles must alternate` | Consecutive same-role messages | Merge adjacent user/assistant messages | | `max_tokens: must be >= 1` | Missing or zero `max_tokens` | Always set `max_tokens` (required param) | | `model: invalid model id` | Typo in model name | Use exact ID: `claude-sonnet-4-20250514` | | `messages.0.content: empty` | Empty message content | Ensure content is non-empty string or array | | `tool_result: tool_use_id not found` | Mismatched tool ID | Copy `id` from the `tool_use` block exactly | ### 401 — `authentication_error` ```bash # Verify your key is set and valid echo $ANTHROPIC_API_KEY | head -c 15 # Should show: sk-ant-api03-... # Test directly with curl curl -s https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model":"claude-sonnet-4-20250514","max_tokens":16,"messages":[{"role":"user","content":"hi"...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

clade-common-errors

Diagnose and fix Anthropic API errors — authentication, rate limits, Use when working with common-errors patterns. overloaded, context length, and content policy issues. Trigger with "anthropic error", "claude 429", "claude overloaded", "anthropic not working", "debug claude api".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-incident-runbook

Execute incident response procedures for Claude API outages and degradation. Use when Claude API is returning errors, experiencing high latency, or showing degraded performance in production. Trigger with phrases like "anthropic incident", "claude api down", "anthropic outage", "claude degraded", "anthropic runbook".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-known-pitfalls

Identify and avoid common Claude API anti-patterns and integration mistakes. Use when reviewing code, onboarding developers, or debugging subtle issues with Anthropic integrations. Trigger with phrases like "anthropic pitfalls", "claude anti-patterns", "claude mistakes", "anthropic common issues", "claude gotchas".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-advanced-troubleshooting

Debug complex Claude API issues including context window overflow, tool use failures, streaming corruption, and response quality problems. Trigger with phrases like "anthropic advanced debug", "claude complex issue", "claude tool use failing", "claude context overflow".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-known-pitfalls

Common mistakes when building with the Anthropic API and how to avoid them. Use when working with known-pitfalls patterns. Trigger with "anthropic mistakes", "claude pitfalls", "anthropic gotchas", "common claude errors", "anthropic anti-patterns".

2,266 Updated today
jeremylongshore