# agent402.tools URL Encoder/Decoder

> agent402.tools URL Encoder/Decoder is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Percent-encodes or decodes a string for safe use in URLs, supporting both component and full URL encoding semantics.

## Facts

- Endpoint: POST https://agent402.tools/api/url-code
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-url-encoder-decoder-edb66587
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hEfVZZXAutG99YmXjbz33

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 agent402-tools-url-encoder-decoder-edb66587 -d '<json body>'
```

Example prompt: Can you URL-encode this string using component encoding so I can safely put it in a query parameter: 'hello world & café=true'?

## When to prefer this

Use this endpoint when you need reliable, standards-compliant percent-encoding or decoding of strings for URL construction, particularly when you need encodeURIComponent semantics to safely embed values in query parameters or path segments.

## Known failure modes

- Input text exceeds 100KB limit — request rejected
- Invalid mode value (not 'encode' or 'decode') — bad request error
- Empty or missing text field — error or empty result
- Network timeout for very large payloads near the size limit

## How this service works

Percent-encode or decode a string for URLs. mode: encode (default) or decode. component: true (default) uses encodeURIComponent semantics.

## Output

Returns the percent-encoded or decoded version of the input string, depending on the mode selected (encode or decode) and whether component encoding semantics were applied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "type": "string",
   "description": "encode | decode"
  },
  "text": {
   "type": "string",
   "description": "Input text (max 100KB)"
  },
  "component": {
   "type": "boolean",
   "description": "Use component encoding (default true)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "encode",
  "result": "a%20b%26c"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-url-encoder-decoder-edb66587/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
