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

  1. Visit app.chaingpt.orgarrow-up-right and connect a crypto wallet to create an account.

  2. Navigate to API Keys and click Create New Secret Key.

  3. Copy the key immediately — it is only displayed once.

  4. Store it securely using an environment variable or secret manager.

Configuring the key

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:

Manual installs

If you installed via git clone, set the key in your .claude/settings.json MCP server configuration (see Installation).

Loading credits

API calls consume credits. To load credits:

  1. Choose a payment method: crypto (USDT, USDC, ETH, BNB, TRX, $CGPT) or credit card.

  2. 1,000 credits costs $10 USD (1 credit = $0.01).

  3. 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):

Or test manually with cURL:

A 200 response means your key is valid. 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: HTTP 402 or 403 responses indicate your credit balance is too low. Top up at app.chaingpt.org/addcreditsarrow-up-right.

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

Last updated

Was this helpful?