Skip to main content

Chat402 Integration Guide

Complete guide to integrating Chat402 into your application.

Table of Contents

Quick Start

1. Get an API Key

Visit chat402.xyz and:
  1. Connect your wallet (MetaMask or Phantom)
  2. Custodial wallets are auto-created for you
  3. Navigate to API Keys page
  4. Generate a new API key (starts with pp_)
  5. Save it immediately - it won’t be shown again!

2. Fund Your Wallet

Send USDC to your custodial wallet address:
  • Ethereum: Send USDC on Base network
  • Solana: Send USDC on Solana mainnet
Minimum deposit: $1 USDC

3. Make Your First Request

Authentication

All API requests require an API key in the Authorization header:

Making Your First Request

Basic Text Prompt

Response Format

Payment Integration

The simplest way - just use your API key:

Using Your Own Wallet (Advanced)

For direct wallet-to-wallet payments with x402 protocol:

Code Examples

Node.js / TypeScript

Python

cURL

Go

Rust

Error Handling

HTTP Status Codes

Error Response Format

Error Codes

Best Practices

1. Secure Your API Key

2. Handle Errors Gracefully

3. Monitor Costs

4. Use Appropriate Models

5. Implement Retry Logic

Webhooks (Coming Soon)

Get notified when:
  • Balance drops below threshold
  • Payments complete
  • API key usage spikes

Rate Limits

Current limits (subject to change):
  • Requests: 100 per minute
  • Concurrent: 10 requests
  • Burst: 200 per minute
Contact us for higher limits.

Support

Changelog

v1.0.0 (2025-10-28)

  • Initial release
  • Support for 10+ AI models
  • Dual-chain payment (Base + Solana)
  • Custodial wallet system
  • x402 payment protocol integration