Integration time: under 1 hour

Add Chargeback Prevention to Your AI Infrastructure

Drop the SDK in at your API edge. Verify agent payments cryptographically. Issue authorization proofs that make disputes cryptographically answerable. Shaped with design partners, no procurement.

What you get

Observer Protocol adds one artifact to every agent transaction on your infrastructure: a cryptographically signed authorization proof that shows the purchase was within a valid delegation's scope. The authorization proof is independently verifiable by any third party: no API key, and no Observer Protocol API in the path. Verifying it fetches the issuer's DID document over ordinary HTTPS, or nothing at all if you supply that document yourself.

Reference integration: Hyperbolic

This guide uses a real integration with Hyperbolic (GPU inference via x402) as the reference. The transaction hashes below are real and verifiable on BaseScan.

Step 1 - Install the SDK

Deprecated, and this guide has not been rewritten off it. @observer-protocol/sdk and the PyPI package observer-protocol were last released in April 2026, are unmaintained, and carry a deprecation notice on the registry itself. Everything below still installs and still runs. For verifying a credential use @observer-protocol/policy-engine instead; for the register/attest flows in Steps 2 and 3 there is no replacement package yet, which is why this page still names the old one. See the SDK page for what replaces which part.

TypeScript

npm install @observer-protocol/sdk

Python

pip install observer-protocol
Step 2 - Register your service as a counterparty

Register your AI infrastructure service with a DID so agents can discover and verify you.

TypeScript

import { ObserverClient } from '@observer-protocol/sdk';

const client = new ObserverClient();

const service = await client.registerAgent({
  publicKey: 'your_ed25519_public_key_hex',
  agentName: 'Your AI Infra Service',
});

// Verify key ownership
const challenge = await client.requestChallenge(service.agentId);
// Sign challenge.nonce with your private key
await client.verifyAgent(service.agentId, signatureHex);

// Your service is now:
// - Discoverable via DID: did:web:observerprotocol.org:agents:{id}
// - Verifiable by any agent or counterparty
// - Ready to issue and verify delegation credentials

Python

from observer_protocol import ObserverClient

client = ObserverClient()
pub, priv = ObserverClient.generate_keypair()

service = client.register_agent(public_key=pub, agent_name="Your AI Infra Service")
challenge = client.request_challenge(service.agent_id)
sig = ObserverClient.sign_challenge(priv, challenge.nonce)
client.verify_agent(service.agent_id, sig)
Step 3 - Verify agent payments

When an agent pays for your service via x402, verify the payment and issue a credential.

TypeScript

// After receiving an x402 payment from an agent
const result = await client.verifyX402({
  agentId: 'd13cdfceaa8f895afe56dc902179d279',
  agentDid: 'did:web:observerprotocol.org:agents:d13cdf...',
  counterparty: 'did:web:your-service.com',
  amount: '100000', // 0.10 USDC in atomic units
  resourceUri: 'https://api.your-service.com/v1/inference',
  settlementTxHash: '0xd94a6d8bfa9c1634e19b59cac9503e732cb538772b96e02300702bc38fb39b94',
  paymentPayload: paymentResponseFromX402,
});

// result.verification.onchainVerified = true
// result.credential = W3C VC signed by OP
// result.eventId = audit trail reference

Python

result = client.verify_x402(
    agent_id="d13cdfceaa8f895afe56dc902179d279",
    agent_did="did:web:observerprotocol.org:agents:d13cdf...",
    counterparty="did:web:your-service.com",
    amount="100000",
    resource_uri="https://api.your-service.com/v1/inference",
    settlement_tx_hash="0xd94a6d8bfa9c...",
    payment_payload=payment_response,
)

assert result.verification.onchain_verified  # True
Step 4 - Verify authorization proofs (any third party can do this)

Verification requires only the authorization-proof JSON and the issuer's published public key. No API key, no token, no Observer Protocol API in the path. Note that resolve_did below fetches the issuer's DID document over ordinary HTTPS from the origin the credential names — supply the document yourself and it makes no network call at all.

from observer_protocol import verify_receipt, resolve_did

issuer_key = resolve_did(receipt_json['issuer']['id'])
result = verify_receipt(receipt_json, issuer_key)
assert result.valid  # cryptographic proof verified

Four lines, no API key, and nothing either OP or the counterparty can withhold to stop it verifying. Any third party can verify.

Real on-chain proof

These are real x402 payments to Hyperbolic's GPU inference API, settled in USDC on Base mainnet, settlement independently confirmed two ways — Coinbase facilitator and Base RPC on-chain. Observer Protocol records that confirmation; it does not perform the settlement.

Verified x402 Payment - Base Mainnet
TX: 0xd94a6d8bfa9c1634...b39b94
Agent: did:web:observerprotocol.org:agents:d13cdfceaa8f895afe56dc902179d279
Counterparty: did:web:hyperbolic.xyz
Amount: 0.10 USDC
Rail: x402 (USDC on Base)
On-chain verified: true
X402PaymentCredential issued
Credential: urn:uuid:8ca6c6e8-d681-428b-b0f9-4b158b6357cc
Issuer: did:web:observerprotocol.org
Schema: observerprotocol.org/schemas/x402/v1.json
Proof: Ed25519Signature2020

What you don't need to change

Ready to integrate?

Per-transaction pricing. No minimum. Ship chargeback prevention today.

npm install @observer-protocol/sdk pip install observer-protocol

Questions? DM @boydcohen on X.

Resources