Step 1: Install SDK
.env:
Step 2: Initialize SDK
Step 3: Chat Example
Step 3: Image Generation
Step 3: Text-to-Speech
Step 4: Supported Networks
- base
- base-sepolia
- solana
- solana-devnet
- polygon
- polygon-amoy
network in SDK, or X-Network in REST requests.
Step 5: Payment Flow
- Requests handle x402 micropayments via PayAI
- If payment is required, the SDK generates a signed payload
- Request is automatically retried after payment
- Failed requests refund your token automatically
X-PAYMENT header with the signed proof.
Step 6: Next Steps
- Explore the API Reference
- Try other models:
gradient-stratos,whisper-1, etc. - Generate embeddings, text-to-speech, or image outputs seamlessly
model and network to switch AI backends.