# 24K Labs Base Encoding/Decoding API

> 24K Labs Base Encoding/Decoding API is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Encodes or decodes a string using base64, base64url, base32, hex, URL/percent-encoding, HTML entities, or data-URIs in a single API call.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/base-encode
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-base-encoding-decoding-api-29b7982f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dMTD8gXZMVkj8Wg6SMsFK

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 24k-labs-base-encoding-decoding-api-29b7982f -d '<json body>'
```

Example prompt: Can you base64-encode the string 'Hello, World!' for me using the standard base64 scheme?

## When to prefer this

Choose this endpoint when you need quick, reliable string encoding or decoding across multiple standard schemes without setting up a local library. Especially useful for agents that need to handle base64, URL-encoding, or HTML entity transformations on the fly without executing code locally. Supports a broader range of schemes (base32, base64url, hex, data-URI) in a single unified call compared to purpose-built single-format tools.

## Known failure modes

- Invalid encoding scheme specified — API returns an error if the scheme is not one of the supported types
- Malformed input for decoding — if the input string is not valid for the specified encoding (e.g. invalid base64 characters), an error is returned
- Empty input string — may return an error or empty result
- Unsupported combination of encoding and direction — some schemes may only support encode or decode

## How this service works

Encode or decode a string across base64, base64url, base32, hex, URL/percent, HTML entities, and data-URIs in one call.

## Output

Returns the transformed string in the requested encoding or decoding format, along with the encoding scheme used and the direction of the operation performed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "op": {
   "type": "string"
  },
  "codec": {
   "type": "string"
  },
  "input": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "NBSWY3DPEB3W64TMMQ======"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-base-encoding-decoding-api-29b7982f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
