# Agent402 AI Responses API (pay-per-call LLM gateway)

> Agent402 AI Responses API (pay-per-call LLM gateway) is a paid API for AI agents from agent402.tools, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Routes a chat/completion request to an allowlisted LLM model and returns a structured response, billed at $0.02 USDC per call via x402 — no signup or API keys required.

## Facts

- Endpoint: POST https://agent402.tools/v1/responses
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-ai-responses-api-pay-per-call-llm-gateway-e8f35f96
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EpjWpbaXVw8xSLFZWSt33

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 agent402-ai-responses-api-pay-per-call-llm-gateway-e8f35f96 -d '<json body>'
```

Example prompt: Using Agent402, ask gpt-4o-mini to explain what the x402 payment protocol is — stream the response back and keep it under 200 tokens.

## When to prefer this

Choose this endpoint when your agent needs to call an LLM without managing API keys or subscriptions, particularly in crypto-native or agentic finance contexts where paying per call in USDC from a wallet is preferred. It is the right choice for autonomous agents that need inference billed directly at the call level, when zero-data-retention is required, or when you want OpenRouter's model selection breadth (558 tools/models) without separate account setup. Prefer alternatives if you need fine-tuned private models, need to exceed the tier token cap, or require non-USDC payment rails.

## Known failure modes

- Insufficient USDC balance or failed x402 payment — request rejected before inference
- Model ID not on the allowlist for the caller's tier — returns error indicating unavailable model
- Input exceeds tier token cap — max_output_tokens clamped or request rejected
- Malformed input array (invalid role/content structure) — 400-level schema validation error
- Upstream model provider outage — error propagated from OpenRouter
- Streaming connection dropped mid-response — partial SSE stream delivered

## How this service works

OpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url https://agent402.tools/v1 and pay $0.02 per call in USDC, no API key, no signup. Same models, caps and price as this tier's /chat/completions route; any model here is served through the Responses wire.

## Output

A JSON response object containing a unique response ID, the model used, token usage breakdown (input, output, total), the assistant's output message(s) with text content, and a completion status. When streaming is enabled, Server-Sent Events are emitted in sequence from response.created through response.completed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "zdr": {
   "type": "boolean",
   "description": "Optional - zero-data-retention providers only"
  },
  "text": {
   "type": "object",
   "description": "Optional {format: {type: \"text\"|\"json_schema\"|\"json_object\", ...}}"
  },
  "input": {
   "description": "A string, or an array of input items ({role, content} messages with input_text / input_image parts, function_call, function_call_output)"
  },
  "model": {
   "type": "string",
   "description": "Model id (OpenRouter naming) - allowlisted per tier; omit (or \"auto\") on the auto tier"
  },
  "tools": {
   "type": "array",
   "description": "Optional function tools ({type:\"function\", name, parameters}); server-side tools are not served"
  },
  "stream": {
   "type": "boolean",
   "description": "Responses SSE events (response.created … response.completed)"
  },
  "reasoning": {
   "type": "object",
   "description": "Optional {effort: \"none\"|\"minimal\"|\"low\"|\"medium\"|\"high\"|\"xhigh\"|\"max\"} - reasoning tokens count against max_output_tokens"
  },
  "instructions": {
   "type": "string",
   "description": "Optional system/developer instructions"
  },
  "max_output_tokens": {
   "type": "integer",
   "description": "Optional output cap (clamped to the tier cap)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "resp_…",
  "model": "openai/gpt-4o-mini",
  "usage": {
   "input_tokens": 14,
   "total_tokens": 32,
   "output_tokens": 18
  },
  "object": "response",
  "output": [
   {
    "id": "msg_…",
    "role": "assistant",
    "type": "message",
    "status": "completed",
    "content": [
     {
      "text": "x402 is an HTTP-native way for agents to pay per request with USDC.",
      "type": "output_text",
      "annotations": []
     }
    ]
   }
  ],
  "status": "completed"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-ai-responses-api-pay-per-call-llm-gateway-e8f35f96/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
