debug
Skill6 starsChanged 3 months agoMITView on GitHub
Troubleshoot ChainGPT API errors and issues. Use when: chaingpt error, api not working, 401, 402, 403, 404, 429, insufficient credits, rate limit, streaming broken, nft stuck, chat history not working. Diagnoses the problem and provides the fix.
- Reads credentials
- Sends data out
144 other projects use a version of this.
Adopted by
Most recently taken up by
- AllThingsSmitty/proven-skillstheir own version, first seen Oct 6, 2026
- prathish-ks/isthmustheir own version, first seen Oct 6, 2026
- muon-m2/magento2-toolstheir own version, first seen Oct 4, 2026
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- nanocoai/nanoclawtheir own version, first seen Oct 4, 2026
- agentic-community/mcp-gateway-registrytheir own version, first seen Oct 4, 2026
Used with
Projects with it also use add-ollama-tool, add-slack and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkilladd-ollama-tool
Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.
Also in 6 projects that use this
MicrosoftSkilladd-slack
Add Slack channel integration via Chat SDK.
Also in 6 projects that use this
sskarzSkilladd-telegram-swarm
Add Agent Swarm (Teams) support to Telegram. Each subagent gets its own bot identity in the group. Requires Telegram channel to be set up first (use /add-telegram). Triggers on "agent swarm", "agent teams telegram", "telegram swarm", "bot pool".
Also in 5 projects that use this
- +9 more from microsoft
Other versions144 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 144
- Yeachan-Heo/oh-my-claudecode★ 40ksame name
- nanocoai/nanoclaw★ 31ksame name
- openai/symphony★ 28ksame name
- anthropics/knowledge-work-plugins★ 26ksame name
- NVIDIA/Model-Optimizer★ 5.2ksame name
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- jsmastery-pro/skills★ 1.4ksame name
- agentic-community/mcp-gateway-registry★ 956same name
- suboss87/FDEOps★ 950same name
- kdlbs/kandev★ 899same name
134 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- aaSkill
- agent-walletSkill
- baseSkill
- bridgeSkill
- chaingptSkill
- dashboardSkill
- defiSkill
- deploySkill
- driftSkill
- hackathonSkill
- hyperliquidSkill
- playgroundSkill
- polymarketSkill
- researchSkill
- scheduled-autonomySkill
- securitySkill
- solanaSkill
- strategySkill
- tradeSkill
- tronSkill
- trustless-agentsSkill
- updateSkill
- x402Skill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 20 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 127 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
If the developer only provides a vague description, ask:
- Distinctive: line 25
Before diagnosing the specific error, verify the developer's environment:
- Distinctive: line 36
Do not print key values or prefixes, ask the developer to paste a key, or enable shell tracing/verbose HTTP output for authenticated …
- Distinctive: line 40
If using the SDK, also check:
- Distinctive: line 105
If this returns 200, the key is valid.
- Distinctive: line 114
Check your balance at https://app.chaingpt.org
- Distinctive: line 184
Check if multiple services or instances share the same API key — each key has its own 200/min limit.
- Distinctive: line 186
Consider using separate API keys for different services if running multiple products concurrently.
- Distinctive: line 196
If persistent (>5 minutes), the service may be experiencing an outage
- Distinctive: line 197
Check ChainGPT status / announcements
- Distinctive: line 215
If stuck for >5 minutes, the job may have failed.
- Distinctive: line 248
Best fix: Use the SDK which handles streaming automatically:
- Distinctive: line 257
Symptom: Follow-up questions do not reference previous context.
- Distinctive: line 263
If using the SDK, ensure you are reusing the same client instance or passing the same sdkUniqueId
- Distinctive: line 287
Verify the context data is not exceeding size limits
- Very specific: line 295
When passing multiple IDs, use array format: categoryId=5&categoryId=12 or categoryId[]=5&categoryId[]=12
- Distinctive: line 302
If that works, add filters back one at a time to find the problematic filter
- Distinctive: line 308
After identifying the issue:
- Distinctive: line 315
After providing the fix, offer:
- Distinctive: line 319
If yes, construct a minimal cURL command that tests the specific fix and execute it.
- Distinctive: line 323
When debugging SDK-specific errors, these are the error classes to catch:
“Common” is measured: kept by at least 6 in 10 of the 127 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ChainGPT API Debug Companion
You are a debugging expert for ChainGPT API integrations. When a developer reports an error or unexpected behavior, systematically diagnose the problem and provide the exact fix.
Step 1: Gather Information
Accept any of the following as input:
- An error message or stack trace
- An HTTP status code
- A description of unexpected behavior
- A code snippet that is not working
If the developer only provides a vague description, ask:
- Which ChainGPT product are you using? (LLM Chat, NFT Generator, Contract Generator, Contract Auditor, News)
- Are you using the SDK or raw REST API?
- What HTTP status code or error message are you seeing?
Step 2: Run Environment Checks
Before diagnosing the specific error, verify the developer's environment:
# Check presence only; never print any part of the key
if [ -n "${CHAINGPT_API_KEY:+set}" ]; then
printf '%s\n' 'CHAINGPT_API_KEY is set'
else
printf '%s\n' 'CHAINGPT_API_KEY is not set'
fiDo not print key values or prefixes, ask the developer to paste a key, or enable shell tracing/verbose HTTP output for authenticated requests. If the key is not set, that is likely the root cause. Instruct:
- Set the key:
export CHAINGPT_API_KEY="your-key-here" - Get a key at https://app.chaingpt.org/apidashboard
If using the SDK, also check:
# Check if SDK package is installed (JavaScript)
cat package.json 2>/dev/null | grep -E "@chaingpt|chaingpt"
# Check Node.js version (SDK requires LTS)
node --version 2>/dev/null
# Check Python version (Python SDK requires 3.7+)
python3 --version 2>/dev/null
# Check if Python SDK is installed
pip3 show chaingpt 2>/dev/nullStep 3: Diagnose by HTTP Status Code
400 — Bad Request
Common causes and fixes:
- Missing
modelfield — All chat-based products requiremodelin the request body.- LLM Chat:
"model": "general_assistant" - Contract Generator:
"model": "smart_contract_generator" - Contract Auditor:
"model": "smart_contract_auditor"
- LLM Chat:
- Missing
questionorprompt— The primary input field is required.- Chat products:
question(string, non-empty) - NFT Generator:
prompt(string, non-empty)
- Chat products:
- Missing Content-Type header — Must include
Content-Type: application/jsonfor POST requests. - Invalid JSON body — Validate JSON syntax. Common issue: trailing commas, unescaped quotes in contract code.
- Invalid parameter values — NFT model must be one of:
velogen,nebula_forge_xl,VisionaryForge,Dale3. Steps must be within model-specific range.
Fix template:
# Verify your request has the correct structure
curl -X POST "https://api.chaingpt.org/chat/stream" \
-H "Authorization: Bearer $CHAINGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"general_assistant","question":"test","chatHistory":"off"}'401 — Unauthorized
Common causes and fixes:
- Missing Authorization header — Must be:
Authorization: Bearer <key> - Wrong header format — Must be
Bearer <key>not just<key>, notToken <key>, notApi-Key <key> - Key expired or revoked — Regenerate at https://app.chaingpt.org/apidashboard
- Extra whitespace or newline in key — Have the developer check the value locally in their secret manager and correct it without copying any part of the key into tool output or the conversation.
- Key from wrong environment — Ensure you are not using a different account's key
Quick test:
# Minimal request to verify auth works
curl -s -o /dev/null -w "%{http_code}" \
-X GET "https://api.chaingpt.org/nft/get-chains?testNet=false" \
-H "Authorization: Bearer $CHAINGPT_API_KEY"If this returns 200, the key is valid. If 401, regenerate at https://app.chaingpt.org/apidashboard.
402 / 403 — Payment Required / Forbidden
Cause: Insufficient credits or credits exhausted.
Fixes:
- Check your balance at https://app.chaingpt.org
- Top up credits at https://app.chaingpt.org/addcredits
- Get 15% bonus by paying with $CGPT token or enabling monthly auto-top-up
- 1,000 credits = $10 USD (1 credit = $0.01)
Cost reference for budgeting:
| Product | Cost per request |
| LLM Chat | 0.5 credits (1.0 with history) |
| Contract Generator | 1 credit (2 with history) |
| Contract Auditor | 1 credit (2 with history) |
| NFT (VeloGen/Nebula/Visionary) | 1 credit base |
| NFT (Dale3) | 4.75-14.25 credits |
| News | 1 credit per 10 records |
404 — Not Found
Cause: Wrong endpoint URL.
Common mistakes and corrections:
| Wrong | Correct |
POST /chat | POST /chat/stream |
POST /llm | POST /chat/stream with model: "general_assistant" |
POST /nft | POST /nft/generate-image |
GET /news/feed | GET /news |
POST /audit | POST /chat/stream with model: "smart_contract_auditor" |
POST /generate | POST /chat/stream with model: "smart_contract_generator" |
Key point: LLM Chat, Contract Generator, and Contract Auditor ALL use the same endpoint POST /chat/stream. Only the model field differs. There is no separate endpoint per product for chat-based services.
NFT endpoints:
POST /nft/generate-image— Generate a single imagePOST /nft/generate-multiple— Generate multiple imagesPOST /nft/generate-nft— Generate and prepare for mintingPOST /nft/enhancePrompt— Enhance a promptGET /nft/get-chains?testNet=false— List supported chainsGET /nft/progress/{collectionId}— Check generation progressPOST /nft/mint— Mint an NFTGET /nft/abi— Get contract ABI
429 — Too Many Requests
Cause: Rate limit exceeded (200 requests/minute per API key).
Fixes:
- Implement exponential backoff:
async function withBackoff(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try { return await fn(); }
catch (e) {
if (e.status === 429) {
const delay = Math.pow(2, i) * 1000;
console.log(`Rate limited. Retrying in ${delay}ms...`);
await new Promise(r => setTimeout(r, delay));
continue;
}
throw e;
}
}
throw new Error('Max retries exceeded');
}- Check if multiple services or instances share the same API key — each key has its own 200/min limit.
- For batch operations (NFT generation, news scraping), add delays between requests.
- Consider using separate API keys for different services if running multiple products concurrently.
5xx — Server Error
Cause: ChainGPT infrastructure issue.
Fixes:
- Retry with exponential backoff (1s, 2s, 4s delays)
- If persistent (>5 minutes), the service may be experiencing an outage
- Check ChainGPT status / announcements
- Try a different product endpoint to see if the issue is isolated
Step 4: Diagnose Product-Specific Issues
NFT Generation Stuck / No Response
Symptom: Request returns a collectionId but no image URL, or status stays "processing".
Diagnosis:
- NFT generation is asynchronous for larger jobs. You must poll for progress:
curl -X GET "https://api.chaingpt.org/nft/progress/{collectionId}" \
-H "Authorization: Bearer $CHAINGPT_API_KEY"- Poll every 3-5 seconds. Large batches can take several minutes.
- If stuck for >5 minutes, the job may have failed. Try regenerating with fewer images or a simpler prompt.
Streaming Response Garbled or Incomplete
Symptom: Streamed text appears as raw chunks, binary-looking data, or cuts off mid-response.
Diagnosis and fixes:
For axios:
// WRONG — axios buffers the response
const res = await axios.post(url, data, { headers });
// CORRECT — set responseType to stream
const res = await axios.post(url, data, {
headers,
responseType: 'stream'
});
res.data.on('data', chunk => process.stdout.write(chunk.toString()));For fetch:
const res = await fetch(url, { method: 'POST', headers, body: JSON.stringify(data) });
const reader = res.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
process.stdout.write(decoder.decode(value));
}Best fix: Use the SDK which handles streaming automatically:
const stream = await chat.createChatStream({ question: '...', chatHistory: 'off' });
stream.on('data', chunk => process.stdout.write(chunk.toString()));
stream.on('end', () => console.log('\nDone'));Chat History Not Persisting
Symptom: Follow-up questions do not reference previous context.
Checklist:
chatHistorymust be set to"on"(string, not boolean)sdkUniqueIdmust be the same across all requests in the session — this is how the server identifies the conversation- Each request with history enabled costs double (0.5 -> 1.0 for LLM, 1 -> 2 for Generator/Auditor)
- If using the SDK, ensure you are reusing the same client instance or passing the same sdkUniqueId
Test:
# Request 1 — establish context
curl -X POST "https://api.chaingpt.org/chat/stream" \
-H "Authorization: Bearer $CHAINGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"general_assistant","question":"My name is Alice","chatHistory":"on","sdkUniqueId":"debug-session-1"}'
# Request 2 — test if context persists
curl -X POST "https://api.chaingpt.org/chat/stream" \
-H "Authorization: Bearer $CHAINGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"general_assistant","question":"What is my name?","chatHistory":"on","sdkUniqueId":"debug-session-1"}'Context Injection Not Working
Symptom: Custom context/knowledge base data is not being used in responses.
Checklist:
useCustomContextmust be set totruein the requestcontextInjectionobject must be provided with the context data- Verify the context data is not exceeding size limits
News Returning Empty Results
Symptom: GET /news returns empty data array or no results.
Checklist:
categoryId,subCategoryId, andtokenIdmust be valid integers — check the reference docs for valid IDs- When passing multiple IDs, use array format:
categoryId=5&categoryId=12orcategoryId[]=5&categoryId[]=12 searchQueryis case-insensitive but must match actual news content- Try without filters first to confirm the endpoint works:
curl -X GET "https://api.chaingpt.org/news?limit=5" \
-H "Authorization: Bearer $CHAINGPT_API_KEY"- If that works, add filters back one at a time to find the problematic filter
Step 5: Provide the Fix
After identifying the issue:
- Explain what went wrong in one sentence
- Show the corrected code or command
- Explain why the fix works
Step 6: Offer to Verify
After providing the fix, offer:
"Want me to run a test request to verify the fix works?"
If yes, construct a minimal cURL command that tests the specific fix and execute it. Confirm the response is successful before closing.
SDK Error Class Reference
When debugging SDK-specific errors, these are the error classes to catch:
JavaScript:
| Product | Error Class |
| LLM Chatbot | Errors.GeneralChatError from @chaingpt/generalchat |
| NFT Generator | Errors.NftError from @chaingpt/nft |
| Contract Generator | Errors.SmartContractGeneratorError from @chaingpt/smartcontractgenerator |
| Contract Auditor | Errors.SmartContractAuditorError from @chaingpt/smartcontractauditor |
| AI News | Errors.AINewsError from @chaingpt/ainews |
Python exceptions (all from chaingpt.exceptions):
AuthenticationError— 401ValidationError— 400InsufficientCreditsError— 402/403RateLimitError— 429NotFoundError— 404ServerError— 5xxStreamingError— streaming issuesTimeoutError— network timeoutConfigurationError— invalid config
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

