Skip to main content
Solana Pulse AI Agent Gateway issues credit-metered API keys through wallet-based authentication. You top up by sending SOL to the gateway wallet, then sign a challenge with your Solana keypair to prove ownership and claim your key. This guide walks through the entire flow from funding to a working API key.
1

Top up your wallet

Send SOL to the gateway wallet address to create a pending API key balance:
The gateway listens for your transfer via a Helius webhook. Once confirmed, a pending claim is created for your wallet address. You do not need to wait for a notification; the claim endpoint will tell you when your key is ready.
2

Fetch a challenge

Request a random 32-byte challenge from the gateway. You will sign this value to prove ownership of your wallet.
Expected response:
3

Sign the challenge

Use @solana/web3.js and tweetnacl to sign the challenge with your keypair. The signature must be base58-encoded.
4

Claim your API key

POST the wallet address, base58 signature, and challenge back to the gateway.
Success response:
Store your API key securely. It is shown only once at claim time and cannot be retrieved again.
5

Use your key on paid endpoints

Pass the key in the x-api-key header on every paid request:

Full end-to-end script

Here is a complete TypeScript script you can run with tsx or ts-node:

Error handling

Result

You now have a credit-metered API key tied to your Solana wallet. Every paid call debits your balance by 0.0022 SOL (2,200,000 lamports). You also receive 50 lifetime free calls and 15 free calls per day before credits are consumed.

Next steps