- Home
- Skills
- APIs & Backend
- LLM API Integration Doctor
Works with the AI tools you already use
LLM API Integration Doctor
Systematic triage for LLM API integration failures, auth errors, rate limits, and streaming bugs.
$5.99
LLM API Integration Doctor
Example session with this skill installed
My OpenAI integration works locally, but on Vercel I get a 401 error even though I added the API key to the dashboard. The code uses the standard Node SDK.
- Read your context and instructions
- Compiled the llm api integration
- Generated the document
The 401 error in your Vercel environment is likely due to an environment variable scope mismatch or a malformed key string.
Triage Report: OpenAI 401 Auth Failure
| Category | Finding | Action |
|---|---|---|
| Root Cause | Environment Variable Scope | Vercel keys are environment-specific. A key added for 'Development' is not available to 'Production' or 'Preview' by default. |
| Evidence | Works locally but fails deployed | The code is correct, but the runtime environment cannot see the OPENAI_API_KEY. |
| Primary Fix | Update Vercel Dashboard | Go to Project Settings > Environment Variables. Ensure the OPENAI_API_KEY has all boxes checked: Production, Preview, and Development. |
| Secondary Fix | Key Sanitation | Check for a trailing newline or invisible space in the value field, which OpenAI's SDK often rejects. |
| Fallback | SDK Initialization | If vars are correct, ensure you are calling new OpenAI({ apiKey: process.env.OPENAI_API_KEY }) and not relying on implicit loading which can fail in edge runtimes. |
Next steps
- Re-deploy the Vercel project after updating the environment variable scopes to trigger a fresh build.
- Check the Vercel Function logs to see if
process.env.OPENAI_API_KEYis undefined at runtime. - Verify that you aren't hitting a project-level usage limit on a new OpenAI account.
llm-api-integration-doctor.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
The problem
LLM API calls are notoriously brittle. You are facing silent 401s, 429 rate limit storms, truncated JSON responses, or streaming connections that work in local dev but hang indefinitely once deployed to Vercel or AWS.
What it does
- Triages auth failures by verifying environment variable parity between local and production runtimes.
- Identifies token overflow and truncation causes by analyzing
max_tokenssettings and model stop reasons. - Debugs streaming bottlenecks, specifically catching buffered chunks and serverless execution timeouts.
- Optimizes request patterns to handle rate limits using exponential backoff instead of fixed-retry loops.
Frameworks & tools
Works with Node.js, Python, and serverless environments calling Anthropic, OpenAI, Groq, Gemini, or OpenRouter via SDKs or raw HTTP.
Why this beats prompting it yourself
Generic LLM debugging often misses infrastructure-level failures like serverless cold-start timeouts or key-format mismatches. This skill uses a specialized protocol to isolate whether a failure is transport, auth, or dependency-related before looking at the code.
Use cases
- Fixing 'Works on my machine' deployment errors in Vercel or Cloudflare Workers.
- Resolving intermittent JSON parsing errors caused by token limit truncation.
- Diagnosing why a streaming UI appears to hang despite the API returning data.
- Implementing proper concurrency caps to prevent 429 errors during batch processing.
Known limitations
This skill does not debug prompt quality or 'hallucinations.' It requires access to the API call site code and environment configuration to be effective.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
2 installs
Downloaded by developers to date
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 15 days ago
- Passed all security checks, Safe to install