# Code Security Scan API

> Code Security Scan API is a paid API for AI agents from scan-api-production-e73f.up.railway.app, paid per call via x402, $0.5/call, status unknown (last checked 2026-10-16).

Scans source code for security vulnerabilities using Semgrep, ESLint, Bandit, and npm audit, charged per scan via x402 micropayment.

## Facts

- Endpoint: POST https://scan-api-production-e73f.up.railway.app/scan/audit?utm_source=zero.xyz
- Price: $0.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-security-scan-api-586c219f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qRQKEp2lzbIYTqsGQms_P

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 code-security-scan-api-586c219f -d '<json body>'
```

Example prompt: Can you scan this JavaScript code for security vulnerabilities — here's the source and my package.json — and let me know what issues it finds?

## When to prefer this

Choose this endpoint when you need a quick, pay-per-use security scan of source code without committing to a subscription, especially when working with JavaScript, TypeScript, Python, or HTML. It is ideal for CI/CD pipelines, one-off code reviews, or agent workflows that need on-demand vulnerability detection across both static code analysis and dependency auditing in a single call.

## Known failure modes

- Payment not received or x402 payment fails — scan not executed
- Unsupported language detected or specified — scan may be skipped or return empty results
- Malformed or missing 'code' field — validation error returned
- Invalid package.json format — dependency audit skipped or error returned
- Scan timeout for very large code inputs
- Network or service unavailability on Railway deployment

## How this service works

Pay-per-scan code security scanning (Semgrep, ESLint, Bandit, npm audit) via x402.

## Output

Returns a structured report of security findings, including vulnerability descriptions, severity levels, affected lines or packages, and tool-specific results from Semgrep, ESLint, Bandit, and/or npm audit depending on the detected or specified language.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "code"
 ],
 "properties": {
  "code": {
   "type": "string",
   "description": "Source code to scan"
  },
  "language": {
   "enum": [
    "javascript",
    "python",
    "typescript",
    "html"
   ],
   "type": "string",
   "description": "Optional; auto-detected if omitted"
  },
  "packageJson": {
   "type": "object",
   "description": "Optional package.json; enables dependency audit"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-security-scan-api-586c219f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from scan-api-production-e73f.up.railway.app](https://www.zero.xyz/host/scan-api-production-e73f.up.railway.app/llms.txt)
