# David Agent Services — Code Review (x402)

> David Agent Services — Code Review (x402) is a paid API for AI agents from david-agent-services.david-works.workers.dev, paid per call via x402, $0.08/call, status unknown (last checked 2026-10-29).

Performs automated code review with findings, severity ratings, and suggestions, payable per-call via USDC on Base with no API key required.

## Facts

- Endpoint: POST https://david-agent-services.david-works.workers.dev/code-review?utm_source=zero.xyz
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/david-agent-services-code-review-x402-03df877f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e1sq4VY0UtEs71TP0NZt0

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 david-agent-services-code-review-x402-03df877f -d '<json body>'
```

Example prompt: Can you do a security-focused code review on this JavaScript snippet I just wrote — flag any SQL injection risks or other high-severity issues? Here's the code: `const query = 'SELECT * FROM users WHERE id = ' + userId;`

## When to prefer this

Choose this endpoint when you need on-demand, pay-per-call code review with no account setup or API key — ideal for AI agents, CI pipelines, or one-off reviews. Prefer this over subscription-based static analysis tools when you want zero onboarding friction and USDC micropayment billing on Base. Best for security, performance, or readability-focused reviews of small-to-medium code snippets up to 24,000 characters.

## Known failure modes

- Empty or missing 'code' field returns a validation error
- Code exceeding 24,000 characters is rejected
- Payment failure or insufficient USDC balance returns a 402 response
- Unsupported language may reduce finding accuracy
- Network or Worker timeout on very large inputs

## How this service works

Pay-per-call summarization, cited research briefs, and code review for AI agents. x402 v2, USDC on Base. No account or API key.

## Output

Returns a JSON object with a natural-language review summary (SUMMARY, ISSUES, SUGGESTIONS sections), a structured findings array (each with line number, rule name, message, and severity), the detected programming language, and an overall riskLevel (e.g. high/medium/low).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "code"
     ],
     "properties": {
      "code": {
       "type": "string",
       "maxLength": 24000,
       "minLength": 1
      },
      "focus": {
       "type": "string",
       "maxLength": 200,
       "description": "e.g. security, performance, readability"
      },
      "language": {
       "type": "string",
       "description": "Optional; auto-detected if omitted"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "engine": "workers-ai+static",
  "review": "SUMMARY … ISSUES … SUGGESTIONS …",
  "findings": [
   {
    "line": 1,
    "rule": "sql-injection",
    "message": "SQL built by string concatenation. Use parameterized queries.",
    "severity": "high"
   }
  ],
  "language": "javascript",
  "riskLevel": "high"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/david-agent-services-code-review-x402-03df877f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from david-agent-services.david-works.workers.dev](https://www.zero.xyz/host/david-agent-services.david-works.workers.dev/llms.txt)
