# WithZero URL Shortener

> WithZero URL Shortener is a paid API for AI agents from agents.withzero.xyz, paid per call via x402 or MPP, price unknown, status unknown (last checked 2026-10-31).

Shortens a long URL into a compact 4-character base62 code hosted at 0url.to/<code>

## Facts

- Endpoint: POST https://agents.withzero.xyz/api/v1/urlshortener/links?utm_source=zero.xyz
- Price: price unknown
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 4
- Tags: x402
- Canonical page: https://www.zero.xyz/c/withzero-url-shortener-e1445ffa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NttVOSFCsahgVGHtB0Z7J

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 withzero-url-shortener-e1445ffa -d '<json body>'
```

Example prompt: Can you shorten this URL for me so I can share it easily: https://example.com/very/long/path/to/some/article?with=lots&of=query&params=here

## When to prefer this

Choose this endpoint when you need a quick, pay-per-use URL shortener with no account setup or API keys required, especially within an autonomous agent workflow using x402 micropayments. It produces links at the 0url.to domain with a 4-character code. Prefer it when your agent needs to create shareable short links on demand without integrating a dedicated URL shortening service like Bitly or TinyURL.

## Known failure modes

- Invalid or malformed URL input — returns an error if the provided URL is not a valid web address
- Missing required 'url' field — request will be rejected
- Payment failure — though listed at $0 USDC, the x402 payment flow may fail if the agent's wallet is misconfigured
- Expired link — the returned short URL will stop resolving after the expiration timestamp

## How this service works

Create a short link that redirects to a long URL for one year.

## Output

Returns a JSON object with the shortened URL (e.g. https://0url.to/Ab3X), the 4-character base62 code assigned to the URL, and an ISO 8601 expiration timestamp indicating when the short link will stop resolving.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "The long URL to shorten."
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "code",
  "shortUrl",
  "expires"
 ],
 "properties": {
  "code": {
   "type": "string",
   "description": "Four-character base62 code assigned to the URL."
  },
  "expires": {
   "type": "string",
   "description": "ISO timestamp at which the code stops resolving."
  },
  "shortUrl": {
   "type": "string",
   "description": "Short URL of the form 0url.to/<code>."
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/withzero-url-shortener-e1445ffa/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.withzero.xyz](https://www.zero.xyz/host/agents.withzero.xyz/llms.txt)
