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
- Create an account at app.quetra.dev
- Register an agent (Agents → Register Agent)
- Create and activate a mandate for that agent (Mandates → Create Mandate)
- Generate an API key (API Keys → Create Key — starts with
sk_)
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.jsonundermcp.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 governed5. 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
- SDK Reference — full list of methods and options
- MCP Server Overview — all 7 tools and connection options
- Webhook Integration — real-time budget alerts and transaction notifications
- REST API Reference — direct API integration
- @quetra/sdk on npm — package details and version history