# Agent402 Metered OpenAI Responses API

> Agent402 Metered OpenAI Responses API is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Drop-in OpenAI Responses API proxy that meters each call via x402 micropayments, billing exact token costs (input + max_output_tokens) at model list price × 1.15, minimum $0.001 USDC

## Facts

- Endpoint: POST https://agent402.tools/v1/metered/responses
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-metered-openai-responses-api-517de159
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aePb-TejSxTuqjPzOW9h4

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-metered-openai-responses-api-517de159 -d '<json body>'
```

Example prompt: Call the Agent402 metered endpoint with gpt-4o, using the instruction 'You are a helpful assistant', send my user message as input, cap the output at 1024 tokens, and stream the response back — it'll settle the USDC cost automatically per request.

## When to prefer this

Choose this endpoint when you need an OpenAI Responses API-compatible interface with zero upfront cost and per-request USDC billing via x402 micropayments — ideal for AI agents, agent fleets, or CLI tools (OpenAI Codex CLI) that already target the OpenAI SDK but need autonomous on-chain payment settlement. Prefer over direct OpenAI when you want crypto-native billing, multi-model routing under one base_url, or fine-grained cost attribution per agent call without a subscription.

## Known failure modes

- Insufficient USDC balance or Permit2 allowance → 402 Payment Required with quoted cost
- Model id not on allowlist for caller's tier → 400 Bad Request
- max_output_tokens exceeds tier cap → value is clamped silently or rejected
- Malformed input array or unsupported content part type → 422 Unprocessable Entity
- Server-side tools requested → not supported, 400 error
- Upstream model provider timeout → 504 Gateway Timeout propagated

## How this service works

OpenAI Responses API billed per request from what the call costs: the 402 quotes exact-BPE input (instructions + input items + tools) plus your max_output_tokens at the model's list price, times 1.15, never under $0.001; an upto (Permit2) or credits buyer settles actual usage under that quote. Point the OpenAI SDK's responses.create(), the OpenAI Agents SDK, or OpenAI Codex CLI's model_providers base_url at https://agent402.tools/v1/metered.

## Output

An OpenAI Responses API-compatible response object containing the model's generated text (or function call), token usage counts, and optionally a stream of SSE events (response.created through response.completed). The caller is charged the exact BPE-computed token cost at model list price × 1.15, settled via x402 Permit2 or credits, minimum $0.001 USDC.

## 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-metered-openai-responses-api-517de159/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)
