27 guides

Troubleshooting How-To Guides

Fix the errors, crashes, and gotchas people hit with AI tools. Each guide isolates one problem and the exact steps to clear it.

API Errors & Auth

Troubleshooting
Beginner7 min

How to Fix an OpenAI 401 'Invalid API Key' Error

Track down why the OpenAI API rejects your key and get a valid request flowing again.

Troubleshooting
Intermediate9 min

How to Fix OpenAI 429 Rate Limit Errors With Backoff

Stop your app from crashing on 429s by adding exponential backoff and reading the retry headers.

Troubleshooting
Beginner6 min

How to Fix Anthropic Claude API 401 Authentication Errors

Resolve authentication_error responses from the Claude API by fixing the header and key format.

Troubleshooting
Beginner8 min

How to Fix Google Gemini 'API Key Not Valid' Errors

Get Gemini API requests working by enabling the API, fixing key restrictions, and using the right endpoint.

Troubleshooting
Beginner8 min

How to Fix an API Key That Loads as Undefined

Solve the classic 'undefined API key' bug by loading your .env file correctly in Node and Python.

Troubleshooting
Intermediate7 min

How to Handle Anthropic 529 'Overloaded' Errors

Keep your Claude integration stable when the API returns 529 overloaded_error by retrying gracefully.

Troubleshooting
Intermediate9 min

How to Fix Rate Limit Errors from an AI API

Diagnose a 429 rate-limit error and add backoff, batching, and concurrency control so your calls stop getting throttled.

Troubleshooting
Intermediate9 min

How to Fix CORS Errors When Calling an AI API From the Browser

Stop CORS failures and protect your key by routing AI API calls through a small backend proxy.

Troubleshooting
Beginner6 min

How to Fix 'Model Not Found' and Deprecated Model Errors

Resolve model_not_found errors caused by typos, retired models, or access your account lacks.

Troubleshooting
Intermediate9 min

How to Rotate a Leaked API Key Without Downtime

Respond to a committed or exposed API key safely by rotating it and purging it from history.

Troubleshooting
Intermediate8 min

How to Fix SSL Certificate Errors When Calling AI APIs

Resolve SSL certificate verify failed errors the safe way instead of disabling verification.

Tokens & Context

Troubleshooting
Beginner5 min

How to count tokens before sending a prompt to Claude

Use the count_tokens endpoint to measure a prompt accurately so you never guess at size or cost.

Troubleshooting
Intermediate10 min

How to Fix 'Context Length Exceeded' Token Limit Errors

Resolve maximum context length errors by counting tokens, trimming input, and chunking long documents.

Troubleshooting
Intermediate8 min

How to fix a context length exceeded error in the Claude API

Diagnose and resolve a request that overflows the model context window by counting tokens and trimming the prompt.

Troubleshooting
Beginner6 min

How to fix a Claude response that gets cut off mid-sentence

Detect a max_tokens cutoff, raise the limit, and switch to streaming so long outputs finish cleanly.

Troubleshooting
Intermediate9 min

How to reduce Claude hallucinations by grounding answers in your documents

Cut fabricated facts by feeding source documents into the prompt and turning on citations so every claim is traceable.

Troubleshooting
Advanced9 min

How to keep a long Claude conversation under the context limit

Turn on server-side compaction so a multi-turn chat summarizes its own history before it overflows the window.

Troubleshooting
Intermediate7 min

How to stop Claude from calling tools when it should not

Fix overtriggering by softening aggressive prompt language and tuning effort instead of adding more guardrails.

Troubleshooting
Advanced9 min

How to handle a Claude Fable 5 refusal with a fallback model

Detect the refusal stop reason and opt into a server-side fallback so a declined request is re-served by another model.

Cost & Reliability

Troubleshooting
Beginner7 min

How to choose the right Claude model for cost and quality

Match Haiku, Sonnet, Opus, or Fable to your task so you neither overpay nor underpower the job.

Troubleshooting
Intermediate10 min

How to cut Claude API costs with prompt caching

Cache a large stable prefix so repeated requests pay roughly a tenth of the input price for the cached part.

Troubleshooting
Intermediate8 min

How to halve Claude costs for bulk jobs with the Batch API

Send non-urgent work through the Message Batches API to get 50 percent off standard token prices.

Troubleshooting
Advanced8 min

How to cap spend on a Claude agent with a task budget

Give an agentic loop a token budget so the model paces itself and finishes gracefully instead of running away.

Troubleshooting
Intermediate9 min

How to Debug an MCP Server That Will Not Connect

Work through the common reasons a Model Context Protocol server shows as failed and get it back to connected.

Troubleshooting
Intermediate7 min

How to Ask an Agent to Explain a Bug Before Fixing It

Make the agent state the root cause first so you can confirm the diagnosis before it writes a fix that masks the real problem.

Troubleshooting
Intermediate7 min

How to Roll Back a Bad Deploy Quickly

Get a broken release reverted in seconds by promoting the last good deploy instead of debugging in production.

Troubleshooting
Intermediate6 min

How to Fix Cursor Not Indexing Your Codebase

Diagnose why Cursor's codebase answers feel blind and force a clean re-index so it sees your whole project again.

Browse other categories