# Secret Detection in Code

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

Scans source code or text for exposed secrets, API keys, credentials, and sensitive tokens

## Facts

- Endpoint: POST https://api.the402.ai/v1/services/svc_315eae8e88b74f50/purchase
- Price: $0.263/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-the402-ai-69e5baec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yJhs8aT5cMM76FTz_TgS7

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-69e5baec -d '<json body>'
```

Example prompt: Scan this code snippet for any exposed secrets, API keys, passwords, or credentials: `AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` and tell me what was found and how severe it is.

## When to prefer this

Use this endpoint when you need to detect hardcoded secrets, API keys, tokens, or credentials in source code or text snippets before committing, deploying, or sharing. Prefer this over general code analysis tools when the specific goal is security-focused secret scanning. Useful in CI/CD pipelines, pre-commit hooks automation, or agent-driven security audits.

## Known failure modes

- Empty or missing code input returns an error
- Overly large code payloads may be rejected or time out
- Payment of $0.263 USDC not provided or insufficient funds causes 402 error
- Malformed request body results in 400 error
- False negatives: obfuscated or encoded secrets may not be detected

## How this service works

Purchase: Secret Detection in Code

## Output

Returns a report of detected secrets found in the submitted code, including the type of secret (e.g. AWS key, GitHub token, password), its location or context within the code, and severity or confidence level of 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-69e5baec/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)
