API REFERENCE
Commerce Trust API
Verify AI agent transactions before execution. Single and batch endpoints with sub-50ms latency.
Base URL
https://nerq.ai/v1/commerce
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Get your API key at /nerq/docs. Free tier: 1,000 req/hr. Pro: 50,000 req/hr.
POST /v1/commerce/verify
Verify a single agent transaction. Returns approval decision with trust metadata.
Request Body
{
"agent_id": "shopping-agent-42",
"counterparty": "vendor-abc",
"action": "purchase",
"risk_tolerance": "medium",
"amount_usd": 250.00,
"metadata": {
"category": "electronics",
"platform": "marketplace-x"
}
}
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Identifier of the agent initiating the transaction |
counterparty | string | Yes | Identifier of the vendor or receiving agent |
action | string | Yes | Transaction type: purchase, sell, negotiate, transfer |
risk_tolerance | string | No | Threshold: low, medium, high. Default: medium |
amount_usd | number | No | Transaction amount in USD for risk-adjusted scoring |
metadata | object | No | Additional context (category, platform, etc.) |
Response
{
"approved": true,
"trust_score": 0.87,
"agent_trust": {
"score": 0.87,
"risk_level": "low",
"provenance": "verified",
"last_audit": "2026-03-10"
},
"counterparty_trust": {
"score": 0.92,
"risk_level": "low",
"provenance": "verified",
"last_audit": "2026-03-11"
},
"decision": {
"action": "approve",
"confidence": 0.94,
"risk_factors": [],
"recommendation": "Transaction meets trust threshold for medium risk tolerance."
},
"latency_ms": 23
}
Response Fields
| Field | Type | Description |
|---|---|---|
approved | boolean | Whether the transaction is approved |
trust_score | number | Combined trust score (0.0–1.0) |
agent_trust | object | Trust details for the initiating agent |
counterparty_trust | object | Trust details for the counterparty |
decision | object | Decision metadata with confidence and risk factors |
latency_ms | number | Server-side processing time in milliseconds |
cURL Example
curl -X POST https://nerq.ai/v1/commerce/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "shopping-agent-42",
"counterparty": "vendor-abc",
"action": "purchase",
"risk_tolerance": "medium"
}'
POST /v1/commerce/verify/batch
Verify multiple transactions in a single request. Max 50 transactions per batch.
Request Body
{
"transactions": [
{
"agent_id": "procurement-bot-7",
"counterparty": "supplier-alpha",
"action": "purchase",
"risk_tolerance": "low"
},
{
"agent_id": "procurement-bot-7",
"counterparty": "supplier-beta",
"action": "negotiate",
"risk_tolerance": "medium"
}
]
}
Response
{
"results": [
{
"index": 0,
"approved": true,
"trust_score": 0.91,
"decision": {"action": "approve", "confidence": 0.95}
},
{
"index": 1,
"approved": true,
"trust_score": 0.84,
"decision": {"action": "approve", "confidence": 0.88}
}
],
"batch_latency_ms": 67
}
SDK Usage
pip install nerq-commerce
Python SDK
from nerq_commerce import NerqCommerce client = NerqCommerce(api_key="YOUR_API_KEY") # Single verification result = client.verify( agent_id="my-agent", counterparty="vendor", action="purchase", risk_tolerance="medium" ) if result.approved: print(f"Approved with score {result.trust_score}") # Batch verification results = client.verify_batch([ {"agent_id": "bot-1", "counterparty": "vendor-a", "action": "purchase"}, {"agent_id": "bot-1", "counterparty": "vendor-b", "action": "negotiate"}, ])
Error Codes
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | Missing required fields or invalid values. Check agent_id, counterparty, and action. |
401 | Unauthorized | Missing or invalid API key. |
429 | Rate Limited | Exceeded rate limit. Free: 1,000 req/hr. Pro: 50,000 req/hr. Retry after Retry-After header. |
500 | Server Error | Internal error. Retry with exponential backoff. If persistent, contact support. |
Rate Limits
| Tier | Rate | Batch Size | Latency SLA |
|---|---|---|---|
| Free | 1,000 req/hr | 10 per batch | Best effort |
| Pro | 50,000 req/hr | 50 per batch | <50ms p95 |
| Enterprise | Custom | Custom | <25ms p95 |
Need help?
Read the Trust Protocol spec for the underlying verification model, or see integration guides for framework-specific setup.