debug
БесплатноБез исполняемых скриптовНе проверенTroubleshoot ChainGPT API errors and issues. Use when: chaingpt error, api not working, 401, 402, 403, 404, 429, insufficient credits, rate limit, streaming…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
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'
fi
Do 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/null
Step 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 w |
Установить debug в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл debug?
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.
Как установить скилл debug?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл debug запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic