API Key Setup
Updated Nov 29, 2026, 01:46 AM
API Key Setup
API Key Setup
All ChainGPT API products require an API key for authentication. This page walks through obtaining a key, configuring it for use with the plugin, and managing your credit balance.
Getting an API key
- Visit app.chaingpt.org and connect a crypto wallet to create an account.
- Navigate to API Keys and click Create New Secret Key.
- Copy the key immediately — it is only displayed once.
- Store it securely using an environment variable or secret manager.
Configuring the key
Environment variable (recommended)
Set the CHAINGPT_API_KEY environment variable in your shell:
export CHAINGPT_API_KEY="your-key-here"
Add this to your .bashrc, .zshrc, or .env file so it persists across sessions.
Plugin installs
If you installed via /plugin install, the MCP server reads CHAINGPT_API_KEY from your environment automatically via the .mcp.json configuration:
{
"mcpServers": {
"chaingpt": {
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/mcp-server/dist/index.js"],
"env": {
"CHAINGPT_API_KEY": "${CHAINGPT_API_KEY}"
}
}
}
}
Manual installs
If you installed via git clone, export CHAINGPT_API_KEY as above and reference it as "${CHAINGPT_API_KEY}" in your MCP server configuration (see Installation). Do not write the raw key into .claude/settings.json.
Loading credits
API calls consume credits. To load credits:
- Visit app.chaingpt.org/addcredits.
- Choose a payment method: crypto (USDT, USDC, ETH, BNB, TRX, $CGPT) or credit card.
- 1,000 credits costs $10 USD (1 credit = $0.01).
- Pay with $CGPT tokens for a 15% bonus on every purchase.
Credits never expire.
Verifying your setup
Test that your key works by asking Claude to check your credit balance (requires the MCP server):
"Check my ChainGPT credit balance"
Or test manually with cURL:
curl -s -o /dev/null -w "%{http_code}" \
-X GET "https://api.chaingpt.org/ai-signal/tags" \
-H "Authorization: Bearer $CHAINGPT_API_KEY"
A 200 response means your key is valid (this call costs no credits). A 401 means the key is invalid or expired — regenerate it from the dashboard.
Common issues
Key not found: Ensure there are no trailing whitespace characters or newlines in the key value. Check with: echo -n $CHAINGPT_API_KEY | wc -c
Wrong header format: The Authorization header must use the Bearer prefix: Authorization: Bearer <key>. Not Token <key> or just the raw key.
Insufficient credits: a project key gets HTTP 402 with code insufficient_balance. An older UUID key gets a generic HTTP 500 for most calls, so check your balance when you see one. Top up at app.chaingpt.org/addcredits.
API authentication details
All ChainGPT API products share the same authentication mechanism:
| Setting | Value |
|---|---|
| Base URL | https://api.chaingpt.org |
| Auth header | Authorization: Bearer <API_KEY> |
| Rate limit | 200 requests/minute per key |
| Content type | application/json for POST requests |