# Forest Agent Tools – Base64 Encode/Decode

> Forest Agent Tools – Base64 Encode/Decode is a paid API for AI agents from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-20).

Encode UTF-8 text to standard or URL-safe Base64, or decode canonical Base64 back to UTF-8 text, with strict size and encoding validation.

## Facts

- Endpoint: POST https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/text/base64?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forest-agent-tools-base64-encode-decode-bade8d40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LW1xUbbK6bbkTiNgVtxZf

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 forest-agent-tools-base64-encode-decode-bade8d40 -d '<json body>'
```

Example prompt: Can you Base64-encode this text using the standard variant: 'Hello, World! This is my payload.'?

## When to prefer this

Choose this endpoint when you need a fast, deterministic, server-side Base64 encode or decode with strict UTF-8 and size validation, and you want to avoid bundling a local library or running untrusted transform code. It handles both standard and URL-safe Base64 variants explicitly, making it suitable for preparing URL query parameters, HTTP headers, or data payloads in agent pipelines.

## Known failure modes

- Input exceeds 100 KiB limit — rejected with a size error
- Decode mode receives an invalid Base64 string — rejected with encoding error
- Decoded bytes are not valid UTF-8 — rejected with UTF-8 validation error
- Missing or invalid mode field — request rejected
- Missing value field — request rejected
- Network or payment failure (HTTP 402 if payment not attached)

## How this service works

Machine-readable contract for active Forest paid capabilities. Unsigned paid calls return HTTP 402 with a PAYMENT-REQUIRED x402 challenge.

## Output

Returns the transformed string — either the Base64-encoded representation of the input UTF-8 text, or the decoded UTF-8 text recovered from a valid Base64 input. The service performs the transform locally and returns a result or a clear error if the input is invalid, non-UTF-8, or exceeds the 100 KiB size limit.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "encode",
    "decode"
   ],
   "type": "string",
   "description": "Public mode value used to scope this lookup."
  },
  "value": {
   "type": "string",
   "maxLength": 136536,
   "description": "Public value value used to scope this lookup."
  },
  "variant": {
   "enum": [
    "standard",
    "url-safe"
   ],
   "type": "string",
   "description": "Public product options used to select an offer."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "mode": "encode",
   "scope": "caller_supplied_text_base64_only",
   "result": "example",
   "variant": "standard",
   "byte_length": 0,
   "input_encoding": "example",
   "output_encoding": "example"
  },
  "meta": {
   "cache": "miss",
   "provider": "node-buffer",
   "checked_at": "2026-01-01T00:00:00.000Z",
   "duration_ms": 0
  },
  "version": "1",
  "capability": "text.base64"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forest-agent-tools-base64-encode-decode-bade8d40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run](https://www.zero.xyz/host/http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/llms.txt)
