# Swift Bot Labs Toolbox – Encode (Multi-Format String Encoding)

> Swift Bot Labs Toolbox – Encode (Multi-Format String Encoding) is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Converts a string between any two of eight encoding formats (utf8, hex, base64, base64url, base32, base58, url, html) deterministically, paying per call in USDC via x402.

## Facts

- Endpoint: POST https://x402-toolbox.swiftbotlab.workers.dev/v1/encode?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-encode-multi-format-string-encoding-076db443
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vsWNE2ws4SmPTbiqqQ6hZ

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 swift-bot-labs-toolbox-encode-multi-format-string-encoding-076db443 -d '<json body>'
```

Example prompt: Convert the utf8 string 'Hello, world!' to base58 encoding using the Swift Bot Labs Toolbox encode API.

## When to prefer this

Choose this endpoint when you need a lightweight, deterministic, pay-per-call encoding conversion across multiple standard formats (utf8, hex, base64, base64url, base32, base58, url, html) without setting up an account or API key. It is ideal for AI agents that need occasional encoding transformations as part of a pipeline and want to pay only for what they use via USDC x402.

## Known failure modes

- Invalid 'from' or 'to' enum value returns an error response
- Input string exceeding 1 MB (1,048,576 bytes) is rejected
- Malformed JSON body returns a parse error
- x402 payment failure prevents the call from completing
- Incompatible encoding pair (e.g. non-hex characters decoded as hex) may return a decoding error

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

Returns a JSON object with ok=true, the tool name ('encode'), and a result object containing the source format, target format, byte count of the input, and the encoded output string.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "enum": [
    "utf8",
    "hex",
    "base64",
    "base64url",
    "base32",
    "base58",
    "url",
    "html"
   ],
   "type": "string",
   "default": "base64"
  },
  "data": {
   "type": "string",
   "maxLength": 1048576
  },
  "from": {
   "enum": [
    "utf8",
    "hex",
    "base64",
    "base64url",
    "base32",
    "base58",
    "url",
    "html"
   ],
   "type": "string",
   "default": "utf8"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "encode",
  "result": {
   "to": "base58",
   "from": "utf8",
   "bytes": 11,
   "result": "StV1DL6CwTryKyV"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-encode-multi-format-string-encoding-076db443/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
