# Agent Security Gateway – Quota Check

> Agent Security Gateway – Quota Check is a paid API for AI agents from agent-security-gateway.onrender.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Checks whether an AI agent has exceeded its tool call quota and returns a block/allow decision with risk level and recommended action.

## Facts

- Endpoint: POST https://agent-security-gateway.onrender.com/api/quota/check
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-security-gateway-quota-check-081da375
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EDyuonAL9M7qaxKZAGC55

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent-security-gateway-quota-check-081da375 -d '<json body>'
```

Example prompt: Before my agent makes another tool call, check whether agent 'agent-42' using tool 'web_search' has exceeded its quota — give me the risk level and whether to allow or block the next action.

## When to prefer this

Use this endpoint when you need a lightweight, pay-per-call quota enforcement gate for AI agents — specifically to check whether a given agent or tool has exceeded its allowed number of tool calls before proceeding. Prefer this over custom rate-limiting middleware when you want out-of-box USDC/x402 payment integration and don't want to manage quota state yourself.

## Known failure modes

- Missing required 'response_content' field returns a 422 validation error
- Agent or tool not found returns allow=true with no reasons (unknown agents pass by default)
- Payment failure via x402 (insufficient USDC balance) returns 402 Payment Required
- Service unavailable on Render free tier cold starts causes timeout
- Malformed JSON body returns 400 Bad Request

## How this service works

Pay-per-request security APIs for autonomous AI agents using x402. Detect Japanese prompt injection, validate content, scan for threats, and perform pre-payment security checks. Built for USDC/Base payments.

## Output

Returns a JSON object with: 'allow' (boolean), 'decision' (allow/block), 'reasons' (list of strings explaining why, e.g. 'tool_calls_limit_exceeded: 100/100'), 'risk_level' (e.g. high/low), 'primitive' (quota-check), and 'recommended_action' (e.g. halt_agent_execution).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "allow": {
   "type": "boolean"
  },
  "reasons": {
   "type": "array"
  },
  "decision": {
   "type": "string"
  },
  "primitive": {
   "type": "string"
  },
  "risk_level": {
   "type": "string"
  },
  "recommended_action": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "allow": false,
  "reasons": [
   "tool_calls_limit_exceeded: 100/100"
  ],
  "decision": "block",
  "primitive": "quota-check",
  "risk_level": "high",
  "recommended_action": "halt_agent_execution"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-security-gateway-quota-check-081da375/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-security-gateway.onrender.com](https://www.zero.xyz/host/agent-security-gateway.onrender.com/llms.txt)
