Back to Integration Options
x402 Native Integration

x402 Native integration

Direct Solana integration with no facilitator middleman. Credio's treasury settles credit straight to the service in USDC, and repayments are verified on-chain. The simplest, most self-contained way to integrate.

Direct Solana

Credit settles straight from the Credio treasury on Solana.

Progressive Credit

Starts at $0.10 and scales to the lifetime cap with repayments.

Trustless Approval

Instant decisions; debt and repayments tracked on-chain.

Quick start

  1. 1. Try paying with your agent's own wallet first.
  2. 2. On insufficient funds, call Credio as a fallback (below).
  3. 3. Repay when your agent has USDC to unlock more credit.
ts
const result = await fetch(
  "https://credio.cc/api/credio/x402/credit-payment",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      agentWalletAddress: "YOUR_SOLANA_WALLET_ADDRESS",
      amount: 0.01,                       // USDC
      recipient: "SERVICE_WALLET_ADDRESS",
      agentMetadata: { agentName: "My Agent", service: "api.example.com" },
    }),
  },
)

const data = await result.json()
if (data.success) {
  console.log("Paid via Credio (x402 Native):", data.transactionSignature)
  console.log("Debt:", data.agentStatus.currentUsdcDebt, "USDC")
}

How settlement actually works

  • Credit issuance: Credio's treasury sends USDC directly to the service on Solana. The facilitator field records which x402 rail your agent runs on; the payment itself is settled from the Credio treasury.
  • Repayment: send USDC back to the treasury and report the tx to /x402/repay — Credio verifies it on-chain before clearing debt.
  • Facilitated repayment: No facilitator middleman — your agent broadcasts the USDC transfer to the treasury itself and pays the tiny Solana network fee (~$0.000005), then reports the tx to /x402/repay.

API reference

POST /api/credio/x402/credit-payment

Response (success)

json
{
  "success": true,
  "paymentMethod": "credit",
  "facilitator": "x402",
  "transactionSignature": "5j7s8K9m...xY9z",
  "amountPaid": 0.01,
  "currency": "USDC",
  "network": "solana-mainnet",
  "agentStatus": {
    "currentUsdcDebt": 0.01,
    "usdcCreditLimit": 0.10,
    "remainingCreditUsd": 0.09,
    "credibilityScore": 50,
    "tierName": "Starter"
  }
}

Notes

  • No API keys — authentication is your Solana wallet address.
  • Registration happens automatically on first payment.
  • Optionally include an Ed25519 signature + message for proof-of-ownership.
  • Repayment: send USDC to the treasury, then POST /api/credio/x402/repay (verified on-chain).