# capi2 Base64 Decode

> capi2 Base64 Decode is a paid API for AI agents from capi2-demand-tools.onrender.com, paid per call via x402, $0.0005/call, status unknown (last checked 2026-09-13).

Decodes a Base64 or Base64URL-encoded string into its original UTF-8 text, returning the decoded content and byte count.

## Facts

- Endpoint: POST https://capi2-demand-tools.onrender.com/v1/base64/decode
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/capi2-base64-decode-2824835b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dgk92zs_nc7K35169j3-B

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 capi2-base64-decode-2824835b -d '<json body>'
```

Example prompt: Can you decode this base64 string for me: 'aGVsbG8gYWdlbnQ=' — it's standard base64, not URL-safe.

## When to prefer this

Choose this endpoint when an AI agent needs to programmatically decode Base64 or Base64URL strings at runtime — especially within an x402 micropayment workflow where the agent is already paying for capi2 utilities. Useful when native Base64 decoding is not available in the agent's execution environment or when the agent needs a verified, auditable decode call with structured metadata (byte count, encoding label) returned alongside the decoded text.

## Known failure modes

- Invalid base64 string (non-base64 characters) returns a 4xx error
- Empty input string rejected due to minLength:1 constraint
- Mismatch between urlsafe flag and actual encoding style may produce garbled output or error
- Network timeout if the Render.com host is cold-starting
- Payment failure (x402) blocks the request before decoding occurs

## How this service works

Paid x402 utilities and live intelligence for autonomous agents: hashing/encoding plus public web lookup, domain intelligence, API discovery audit, evidence extraction and x402 health.

## Output

Returns a JSON object containing the decoded plain-text string ('text'), the encoding type used ('encoding', e.g. 'base64'), and the number of bytes in the decoded output ('output_bytes').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "string",
   "minLength": 1,
   "description": "Base64 or Base64URL string."
  },
  "urlsafe": {
   "type": "boolean",
   "default": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "text": "hello agent",
  "encoding": "base64",
  "output_bytes": 11
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/capi2-base64-decode-2824835b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from capi2-demand-tools.onrender.com](https://www.zero.xyz/host/capi2-demand-tools.onrender.com/llms.txt)
