# 24K Labs Base64/Hex/URL Codec

> 24K Labs Base64/Hex/URL Codec 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 across base64, base64url, hex, and URL/percent encoding formats.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/base64-hex-codec
- 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-base64-hex-url-codec-016b50af
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iJCnuVUynb3Fsz9Z6e2Ko

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-base64-hex-url-codec-016b50af -d '<json body>'
```

Example prompt: Can you base64-encode the string 'Hello, World!' for me? I need the standard base64 output, not the URL-safe variant.

## When to prefer this

Choose this endpoint when an AI agent needs a fast, pay-per-use encoding/decoding utility without standing up local logic — especially within an x402-enabled payment workflow. It supports four encoding schemes (base64, base64url, hex, URL/percent-encoding) in a single endpoint, making it ideal when the exact encoding format may vary at runtime. Prefer it over implementing encoding locally when operating in a sandboxed or stateless agent environment.

## Known failure modes

- Invalid encoding format specified — returns error indicating unsupported format
- Malformed input for decode operations (e.g. invalid base64 characters) — returns decoding error
- Missing required fields such as input string or direction — returns validation error
- Payment failure via x402 protocol — returns 402 Payment Required
- Network timeout or service unavailability — returns 5xx error

## How this service works

Encode or decode a string across base64, base64url, hex, and URL/percent encoding.

## Output

Returns the transformed string in the requested encoding format — either the encoded representation of the input or the decoded plaintext, depending on the direction specified. Response includes the output string and likely reflects the target encoding type used.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-base64-hex-url-codec-016b50af/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)
