Quickstart

Get AI agent spending governance running in under 5 minutes. Two paths: the MCP remote server for zero-code setup with Claude or OpenClaw, or the SDK for custom agent apps.

Prerequisites

  1. Create an account at app.quetra.dev
  2. Register an agent (Agents → Register Agent)
  3. Create and activate a mandate for that agent (Mandates → Create Mandate)
  4. Generate an API key (API Keys → Create Key — starts with sk_)
Recommended

Path 1: MCP Remote Server (Zero Code)

The fastest way to get started. One URL — no npm packages, no Node.js, no code. Works with Claude Desktop, Claude Code, and OpenClaw. Supports multiple agents with automatic routing.

Your Server URL

https://mcp.quetra.dev/<your-api-key>/mcp

Replace <your-api-key> with the key from step 4 above.

Connect It

  • Claude Code: Settings → MCP Servers → Add Remote Server → paste the URL
  • Claude Desktop: Settings → Connectors → Add → paste the URL
  • OpenClaw: Add to ~/.openclaw/openclaw.json under mcp.servers.quetra.url

Try It

Restart your client and try these prompts:

  • "Check my QuetraAI budget status"
  • "Can I spend $2.00 on research at firecrawl.dev?"
  • "Show my recent QuetraAI transactions"

For detailed setup guides, see Claude Desktop / Code or OpenClaw. Full tools reference at MCP Server Overview.

Path 2: SDK Integration (Custom Apps)

For your own agent apps and custom integrations, install the TypeScript SDK to add spending governance programmatically. Works with any framework — LangChain, Vercel AI SDK, Claude Agent SDK, or plain Node.js.

1. Install the SDK

npm install @quetra/sdk

2. Create a Client

import { QuetraClient } from "@quetra/sdk";

const client = new QuetraClient({
  apiKey: process.env.QUETRA_API_KEY!,
  agentId: "your-agent-uuid-here",
  gatewayUrl: "https://gateway.quetra.dev", // optional, this is the default
});

Replace your-agent-uuid-here with the agent ID from the dashboard.

3. Evaluate a Transaction

const result = await client.evaluate({
  amount: 500,        // $5.00 (amounts in cents)
  vendor: "api.example.com",
  category: "research",
});

if (result.decision === "approved") {
  console.log("Approved! Remaining:", result.remainingBudget);
} else {
  console.log("Rejected:", result.rejectionReasons);
}

The gateway evaluates the transaction against all mandate rules (AND logic), atomically decrements the budget if approved, and writes to the audit log.

4. Use Budget-Aware Fetch

For x402-compatible APIs, use client.fetch() — it automatically handles 402 Payment Required responses:

// Automatic x402 flow: request → 402 → evaluate → retry with payment
const data = await client.fetch("https://paid-api.example.com/research", {
  method: "GET",
});

console.log(data); // The API response, fully paid and governed

5. Check Budget Status

const budget = await client.getBudgetStatus();

console.log(budget);
// {
//   totalBudget: 5000,      // $50.00
//   spent: 1200,            // $12.00
//   remaining: 3800,        // $38.00
//   perTransactionLimit: 1000, // $10.00 max per tx
//   resetPeriod: "weekly",
//   nextReset: "2026-04-07T00:00:00Z"
// }

Next Steps