# AsterPay AI Code Review

> AsterPay AI Code Review is a paid API for AI agents from x402.asterpay.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Analyzes submitted code and returns a quality score, line-level issues with severity and suggestions, and a human-readable summary

## Facts

- Endpoint: POST https://x402.asterpay.io/v1/ai/code-review
- 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/asterpay-ai-code-review-d6077d46
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-NxuFQGqWo6Ba_Akzdcnt

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 asterpay-ai-code-review-d6077d46 -d '<json body>'
```

Example prompt: Can you review this function for me and give it a quality score, flag any issues with line numbers and severity, and suggest improvements? Here's the code: `function add(a, b) { return a + b; }`

## When to prefer this

Choose this endpoint when you need a per-call, pay-as-you-go code review with line-level granularity and a numeric quality score, especially within an AI agent workflow that handles x402 micropayments in USDC on Base. Prefer it over static linting tools when you want a blended quality score with natural-language suggestions per issue.

## Known failure modes

- Empty or missing code body returns a 400 validation error
- Extremely large code submissions may time out or be rejected
- Malformed request body returns a parsing error
- Payment not attached or insufficient USDC balance returns a 402 Payment Required
- Unsupported language or binary content may produce low-confidence results

## How this service works

Trust, discovery, and fiat settlement layer for AI agent commerce. Dual-protocol: accepts both x402 and MPP payments in USDC on Base. EUR/GBP/USD fiat settlement via SEPA Instant.

## Output

Returns a numeric quality score (e.g. 7.5 out of 10), an array of issues each containing line number, message, severity (e.g. warning/error), and a suggestion, plus a plain-English summary of the overall code quality.

## Example request

```json
{
 "input": {
  "body": {
   "code": "function calculateSum(numbers) {\n  let total = 0;\n  for (let i = 0; i < numbers.length; i++) {\n    total += numbers[i];\n  }\n  return total;\n}",
   "language": "javascript"
  },
  "type": "http",
  "method": "POST",
  "headers": {
   "Content-Type": "application/json"
  },
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string"
  },
  "language": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "score": 7.5,
  "issues": [
   {
    "line": 1,
    "message": "Missing type annotations",
    "severity": "warning",
    "suggestion": "Add TypeScript types"
   }
  ],
  "summary": "Clean function with minor improvements suggested."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/asterpay-ai-code-review-d6077d46/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.asterpay.io](https://www.zero.xyz/host/x402.asterpay.io/llms.txt)
