# the402.ai Secret Detection in Code

> the402.ai Secret Detection in Code is a paid API for AI agents from api.the402.ai, paid per call via x402, $0.105/call, status unknown (last checked 2026-09-15).

Scans source code to detect secrets, credentials, API keys, and sensitive tokens that should not be committed or exposed

## Facts

- Endpoint: POST https://api.the402.ai/v1/services/svc_f993cb1df9ff43f5/purchase
- Price: $0.105/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-the402-ai-6ef0294d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kwhJr_styhSETbpuUYbAs

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 api-the402-ai-6ef0294d -d '<json body>'
```

Example prompt: Scan this code snippet for any hardcoded secrets, API keys, or credentials that shouldn't be there: 'const DB_PASSWORD = "mysecretpassword123"; const API_KEY = "sk-abc123xyz";'

## When to prefer this

Use this endpoint when you need to detect hardcoded secrets, API keys, tokens, passwords, or other credentials in source code snippets or files — especially as a pre-commit check or code review step. Prefer this over generic static analysis tools when the specific goal is credential and secret leakage detection.

## Known failure modes

- Empty or malformed code input returns error
- Obfuscated or minified code may reduce detection accuracy
- No secrets found returns empty results list
- Payment failure prevents execution
- Very large code files may be truncated or rejected

## How this service works

Purchase: Secret Detection in Code

## Output

Returns a list of detected secrets found in the submitted code, including the type of secret (e.g. API key, password, token), its location or context within the code, and severity or confidence level for each finding

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "id"
 ],
 "properties": {
  "id": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-the402-ai-6ef0294d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.the402.ai](https://www.zero.xyz/host/api.the402.ai/llms.txt)
