DocsREST API Reference

REST API Reference

Directly integrate with the Modexia Gateway from any environment. Our API is served securely over HTTPS.

Base URL: https://api.modexia.software
All endpoints require authentication headers.

User & Wallet Operations

POST/registerRegister a new user account
GET/api/v1/user/meGet your profile, wallet address, balance, and API key
POST/api/v1/user/activateActivate your agent wallet (creates a smart account)
POST/api/v1/user/rotate-keyGenerate a new API key (invalidates the old one immediately)
GET/api/v1/user/faucetGet test credits from the sandbox faucet

Payments & Transactions

POST/api/v1/agent/paySend a payment to a recipient address
GET/api/v1/agent/transaction/:idPoll the status (PENDING, COMPLETE) of a specific transaction
GET/api/v1/agent/transactionsList all historical transactions for your wallet

High-Frequency Vaults (Micropayments)

POST/api/v1/vault/openOpen a new pre-funded payment channel
POST/api/v1/vault/consumeExecute a gasless, high-frequency micropayment off-chain
POST/api/v1/vault/settleClose a channel and settle the final balance on-chain
GET/api/v1/vault/status/:channelIdGet the current remaining balance and usage of a channel
GET/api/v1/vault/channelsList all payment channels for your agent
GET/api/v1/vault/micro-transactionsList off-chain consume receipts for a specific channel

Spending Policies

GET/api/v1/agent/policy/:addressRead the current limits for an agent address
POST/api/v1/agent/policyOverride spending limits for a specific agent
POST/api/v1/user/policySet global default spending limits for all wallets

Example Request

Making a payment via raw HTTP POST. We recommend providing an idempotencyKey to safely retry failed network requests.

bash
curl -X POST https://api.modexia.software/api/v1/agent/pay \
  -H "x-modexia-key: mx_test_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "providerAddress": "0x742d35Cc6634C0532925a3b...",
    "amount": "5.0",
    "idempotencyKey": "unique-request-id-12345"
  }'

Response: 200 OK {"success": true, "txId": "..."}