Greene Comply
Docs

Authorize spend over REST or MCP.

One endpoint does the work: send a spend intent, get back approve, deny, or hold. Connect from your own stack with an API key, or drop the native MCP server into Cursor or Claude Desktop.

Quick start

Call the API in seconds

Every spend goes through a single POST /api/agents/authorize call. Send a delegate token and an amount; the policy engine returns a decision.

bash
curl -X POST "https://api.example.com/api/agents/authorize" \
  -H "Authorization: Bearer $GC_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "token": "<delegate_token>",
    "amount": 12.50,
    "merchant_name": "Anthropic",
    "merchant_category": "saas"
  }'

Production hosts and request paths are shown in your workspace after you sign in.

Authentication

API keys & OAuth

Authenticate with a bearer token in the Authorization header:

  • gc_live_ / gc_test_ — API keys minted on the Developer page. Best for server-side integrations.
  • oat_ — short-lived OAuth access tokens issued through the “Connect with Greene” flow for remote MCP clients.

Keys are shown once and stored hashed. Rotate or revoke them any time from the Developer page and Settings.

Reference

The authorize endpoint

FieldTypeDescription
tokenreqstringDelegate token that scopes the spend to a guard rail.
amountreqnumberSpend amount in USD.
merchant_namestringMerchant or vendor name (logged).
merchant_categorystringCategory slug — checked against blocked categories.
descriptionstringHuman-readable memo recorded in the audit log.
model / input_tokens / output_tokensstring / numberOptional LLM cost attribution, recorded to the ledger.

An approval returns the transaction id and remaining budget:

json
{
  "authorized": true,
  "transaction_id": "a1b2c3d4-…",
  "remaining_balance": 487.50,
  "message": "Transaction approved"
}

Other outcomes carry a status code and a machine-readable reason your agent can branch on:

json
// 403 — denied by policy
{ "authorized": false, "code": "over_single_max", "reason": "Amount exceeds per-transaction limit" }

// 202 — held for human approval
{ "authorized": false, "status": "pending_approval", "pending_approval_id": "…", "transaction_id": "…" }

// 402 — out of credits
{ "error": "Payment Required", "link": "/dashboard/top-up" }

// 401 — bad API key or token   ·   429 — rate limited
MCP

Model Context Protocol

Greene Comply ships a native MCP server (packages/greene-mcp) that exposes an authorize_spend tool and a health_check tool. Point your MCP host at it with your base URL and API key:

jsonmcp config
{
  "mcpServers": {
    "greene-comply": {
      "command": "node",
      "args": ["packages/greene-mcp/dist/index.js"],
      "env": {
        "GREENE_BASE_URL": "https://api.example.com",
        "GREENE_API_KEY": "gc_live_…"
      }
    }
  }
}

For hosted clients like ChatGPT, use the remote MCP endpoint at /api/mcp and connect over OAuth — no key handling required. Manage connected sessions from Settings.

Settlement

USDC settlement over Circle

BetaTestnet

Authorization is the source of truth; settlement is a swappable rail that runs after an approve. When a spend target is configured for the circle_usdc rail, Greene Comply moves USDC over Circle Developer-Controlled Wallets and pins the on-chain transaction hash to the decision. We never take custody — Circle is the regulated custodian, and today settlement runs on Base Sepolia testnet only.

json
// On an approved spend whose target uses the "circle_usdc" rail,
// Greene Comply settles asynchronously over Circle and records the result.
// Settlement never blocks the authorize response — poll the transaction
// (or watch Activity) for the on-chain state.

// outbound_spend_executions row, once settled:
{
  "transaction_id": "a1b2c3d4-…",
  "rail":           "circle_usdc",
  "status":         "succeeded",
  "external_ref":   "0xabc123…",        // on-chain tx hash
  "chain":          "BASE-SEPOLIA"
}

Settlement is best-effort and asynchronous: a failed or skipped transfer never changes the authorize outcome or your audit record. Mainnet is gated on counsel review.

SDK

x402 toll-booth

Coming soon

The forthcoming open-source @greene-comply/x402 middleware lets you paywall any endpoint for paying agents — it returns an HTTP 402, settles a sub-cent USDC payment over Circle, and can verify a Greene attestation before letting the request through. See the x402 toll-booth overview for the quickstart.

Ready to wire it up?

Create a free account, mint a key, and make your first authorized spend.

Start free