REST API

The QuetraAI gateway exposes 59 REST endpoints for complete programmatic control over agent governance. Base URL: https://gateway.quetra.dev/api/v1

Authentication

All API requests require an API key in the Authorization header:

Authorization: Bearer sk_your_api_key_here

API keys are scoped to your organization. Create and manage keys at app.quetra.dev → API Keys.

Core Endpoints

Gateway (Evaluation)

MethodPathDescription
POST/gateway/evaluateEvaluate a transaction against mandate rules
POST/gateway/x402/payProcess x402 payment with mandate evaluation
GET/gateway/mandate-tokenGet signed mandate token for agent

Agents

MethodPathDescription
POST/agentsRegister a new agent
GET/agentsList all agents (with ?include=mandate)
GET/agents/:idGet agent by ID
PATCH/agents/:idUpdate agent
DELETE/agents/:idDelete agent

Mandates

MethodPathDescription
POST/mandatesCreate a new mandate (draft)
GET/mandatesList all mandates
GET/mandates/:idGet mandate by ID
PATCH/mandates/:idUpdate mandate
POST/mandates/:id/activateActivate a draft mandate
POST/mandates/:id/revokeRevoke an active mandate
PATCH/mandates/:id/budgetUpdate budget on active mandate
DELETE/mandates/:idDelete mandate

Transactions

MethodPathDescription
GET/transactionsList transactions (with ?limit, ?offset, ?agentId filters)

Example: Evaluate a Transaction

curl -s -X POST https://gateway.quetra.dev/api/v1/gateway/evaluate \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "your-agent-uuid",
    "amount": 500,
    "vendor": "api.example.com",
    "category": "research"
  }'

# Response:
# {
#   "decision": "approved",
#   "remainingBudget": 4500,
#   "transactionId": "tx_abc123...",
#   "evaluationDetails": { ... }
# }

Response Codes

CodeMeaning
200Success
400Validation error (check request body)
401Invalid or missing API key
409Conflict (e.g., agent already has active mandate)
429Usage limit exceeded for your plan tier

Related Resources