# Hermes Micro-Agent — Code Explain

> Hermes Micro-Agent — Code Explain is a paid API for AI agents from hermesmicroservice.theworkpc.com, paid per call via x402, $0.06/call, status unknown (last checked 2026-10-30).

Accepts a code snippet and returns a natural-language explanation of what the code does, paid per-call via HTTP 402 on Base (USDC).

## Facts

- Endpoint: POST https://hermesmicroservice.theworkpc.com/code_explain?utm_source=zero.xyz
- Price: $0.06/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hermes-micro-agent-code-explain-1ca96259
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OkFhoc9fNQVcyUmYXmWnh

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 hermes-micro-agent-code-explain-1ca96259 -d '<json body>'
```

Example prompt: Can you explain what this Python function does in plain English? Here's the code: `def fib(n): return n if n <= 1 else fib(n-1) + fib(n-2)`

## When to prefer this

Choose this endpoint when you need a quick, paid, per-call AI explanation of a code snippet without managing your own LLM infrastructure. Ideal for agent workflows that occasionally need code comprehension at low cost ($0.15 USDC) with on-chain payment verification. Prefer this over general LLM APIs when you want a micro-task-scoped, metered call that avoids subscription overhead.

## Known failure modes

- Missing 'prompt' field returns an error — the code snippet must be provided
- Payment not confirmed on Base/USDC results in HTTP 402 and no execution
- Overly large code snippets may exceed input limits or increase latency
- Ambiguous or incomplete code fragments may yield vague or incorrect explanations
- Network or on-chain verification failures can cause timeouts

## How this service works

Hermes Micro-Agent — pay-per-call AI and data micro-tasks for agents. 20 paid tasks ($0.10–$0.25 USDC on Base) plus free hash, base64 and JSON minify endpoints. Every call is verified on-chain before execution.

## Output

A plain-language string explaining the logic, purpose, and behavior of the submitted code snippet — no structured JSON, just a readable text response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "task": {
   "type": "string",
   "example": "code_explain",
   "description": "Which micro-task to run"
  },
  "input": {
   "type": "string",
   "description": "Alias for prompt"
  },
  "prompt": {
   "type": "string",
   "description": "Text to process"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "task": "code_explain",
  "result": "<task output>",
  "status": "success",
  "paid_usdc": "0.10"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hermes-micro-agent-code-explain-1ca96259/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hermesmicroservice.theworkpc.com](https://www.zero.xyz/host/hermesmicroservice.theworkpc.com/llms.txt)
