Agnic

Core Concepts

Understand the key concepts behind Agnic - X402, wallets, tokens, and transaction flows.

Core Concepts

Before diving into the API, it helps to understand the key concepts that power Agnic.

The X402 Protocol

X402 is a proposed HTTP status code (like 404 for "Not Found") that means "Payment Required". When an API returns 402, it includes authorization instructions that tell the client how to access the resource.

How X402 Works

┌─────────┐                    ┌─────────┐                    ┌─────────┐
│  Your   │  1. Request data   │ X402    │                    │ Agnic   │
│  App    │ ────────────────>  │  API    │                    │  Pay    │
│         │                    │         │                    │         │
│         │  2. 402 + terms    │         │                    │         │
│         │ <───────────────── │         │                    │         │
│         │                    │         │                    │         │
│         │  3. Sign authz     │         │                    │         │
│         │ ────────────────────────────────────────────────> │         │
│         │                    │         │                    │         │
│         │  4. Authz proof    │         │                    │         │
│         │ <──────────────────────────────────────────────── │         │
│         │                    │         │                    │         │
│         │  5. Request + proof│         │                    │         │
│         │ ────────────────>  │         │                    │         │
│         │                    │         │                    │         │
│         │  6. 200 OK + data  │         │                    │         │
│         │ <───────────────── │         │                    │         │
└─────────┘                    └─────────┘                    └─────────┘

Why X402?

Traditional APIsX402 APIs
Sign up for each serviceOne wallet for all APIs
Manage multiple API keysUse-per-request, no subscriptions
Monthly billing cyclesInstant microtransactions
Manual approval neededAutomated transactions

Authorization Schemes

Agnic supports two X402 authorization schemes:

Exact Scheme (EIP-3009)

  • How it works: TransferWithAuthorization - funds transfer exactly on use
  • Best for: One-time transactions, precise billing
  • Chains: Base (EVM), Solana

Upto Scheme (EIP-2612)

  • How it works: Permit - pre-authorize up to an amount
  • Best for: Streaming responses, variable costs
  • Chains: Base (EVM)

Agnic automatically detects and handles both schemes.

Wallets

Embedded Wallets

When you sign up, Agnic creates an embedded wallet for you using Privy. This wallet:

  • Is non-custodial (you control the keys)
  • Works on Base and Solana
  • Holds USDC for transactions
  • Supports delegation for automated signing

Delegation (Session Signers)

To enable automated transactions, you delegate signing authority to Agnic:

  1. You set spending limits (per-transaction, daily, monthly)
  2. You sign a delegation message
  3. Agnic can sign authorizations within your limits
  4. You can revoke access anytime

Delegation never gives Agnic access to your full balance - only the ability to sign authorizations within your specified limits.

API Tokens

API tokens authenticate requests to Agnic. Each token has:

PropertyDescription
maxPerTransactionMaximum USD per single transaction
dailyLimitTotal USD allowed per 24 hours
monthlyLimitTotal USD allowed per 30 days
networksAllowed networks (Base, Solana)
labelYour custom label

Token Types

PrefixTypeUse Case
agnic_tok_API TokenDirect API access
agnic_at_OAuth Access TokenUser-authorized apps
agnic_rt_OAuth Refresh TokenRefresh access tokens

Spending Limits

Spending limits protect you from unexpected charges:

Per-Transaction Limit: $1.00
├── Blocks any single transaction > $1.00
└── Useful for capping AI response costs

Daily Limit: $10.00
├── Resets every 24 hours
└── Prevents runaway automation

Monthly Limit: $50.00
├── Resets every 30 days
└── Budget control for long-term use

Networks

Agnic supports multiple blockchain networks:

NetworkTokenUse Case
Base (Mainnet)USDCProduction transactions
Base SepoliaUSDC (testnet)Development/testing
SolanaUSDCProduction transactions
Solana DevnetUSDC (devnet)Development/testing

OAuth tokens are restricted to mainnet networks only (Base, Solana). API tokens can access testnets.

Credits

New users receive $5 in free credits. Credits are used before your wallet balance and:

  • Never expire
  • Work on all networks
  • Are non-transferable
  • Don't require funding your wallet

Next Steps

On this page