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)
| Method | Path | Description |
|---|
POST | /gateway/evaluate | Evaluate a transaction against mandate rules |
POST | /gateway/x402/pay | Process x402 payment with mandate evaluation |
GET | /gateway/mandate-token | Get signed mandate token for agent |
Agents
| Method | Path | Description |
|---|
POST | /agents | Register a new agent |
GET | /agents | List all agents (with ?include=mandate) |
GET | /agents/:id | Get agent by ID |
PATCH | /agents/:id | Update agent |
DELETE | /agents/:id | Delete agent |
Mandates
| Method | Path | Description |
|---|
POST | /mandates | Create a new mandate (draft) |
GET | /mandates | List all mandates |
GET | /mandates/:id | Get mandate by ID |
PATCH | /mandates/:id | Update mandate |
POST | /mandates/:id/activate | Activate a draft mandate |
POST | /mandates/:id/revoke | Revoke an active mandate |
PATCH | /mandates/:id/budget | Update budget on active mandate |
DELETE | /mandates/:id | Delete mandate |
Transactions
| Method | Path | Description |
|---|
GET | /transactions | List 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
| Code | Meaning |
|---|
| 200 | Success |
| 400 | Validation error (check request body) |
| 401 | Invalid or missing API key |
| 409 | Conflict (e.g., agent already has active mandate) |
| 429 | Usage limit exceeded for your plan tier |
Related Resources
- @quetra/sdk — TypeScript client that wraps these endpoints
- MCP Server — zero-code access to these endpoints via MCP tools
- @quetra/sdk on npm
- Hono Framework — the framework powering the gateway