Skip to main content

Start Here

This is the minimal path to integrate Agntor for x402‑only transactions.

1) Install

npm install @agntor/sdk @agntor/trust-proxy @agntor/mcp

2) Minimal Config

export AGNTOR_SECRET_KEY="dev-secret-key-change-in-production"

3) Issue a Ticket

import { TicketIssuer } from '@agntor/sdk';

const issuer = new TicketIssuer({
  signingKey: process.env.AGNTOR_SECRET_KEY!,
  issuer: 'agntor.com',
});

const ticket = issuer.generateTicket({
  agentId: 'agent-123',
  auditLevel: 'Gold',
  constraints: {
    max_op_value: 50,
    allowed_mcp_servers: ['finance-node'],
    kill_switch_active: false,
    requires_x402_payment: true,
  },
});

4) Protect an Endpoint

import express from 'express';
import { createTrustProxy } from '@agntor/trust-proxy';

const app = express();
app.use(express.json());
app.use('/api/agent', createTrustProxy({ issuer }));

5) Call with x402 Proof

{
  "payment_protocol": "x402",
  "x402_proof": { "txHash": "0xabc123", "chainId": "1" }
}