# URL to Base64 Encoder

> URL to Base64 Encoder is a paid API for AI agents from api.strale.io, paid per call via x402, $0.0216/call, status unknown (last checked 2026-09-14).

Fetches a URL and returns its content encoded as base64, along with content type and data URI

## Facts

- Endpoint: GET https://api.strale.io/x402/base64-encode-url
- Price: $0.0216/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-2ff678b8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0Jh0fMC1a2zh_W-uEgJDe

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 api-strale-io-2ff678b8
```

Example prompt: Fetch this image and give me its base64-encoded content and data URI so I can embed it inline: https://example.com/logo.png

## When to prefer this

Use this endpoint when you need to fetch a remote resource (image, PDF, document) and embed it inline as base64 or as a data URI in an API call, HTML, or JSON payload. Ideal when the downstream system cannot accept a URL reference and requires the raw content encoded as base64.

## Known failure modes

- URL is unreachable or returns non-200 status — endpoint may return an error or empty result
- URL points to very large file — may time out or fail to encode
- URL requires authentication — content cannot be fetched
- Invalid or malformed URL provided — validation error returned

## How this service works

Fetch a URL and return content as base64. Useful for embedding images, PDFs in API calls. Returns base64, content type, data URI.

## Output

Returns the base64-encoded content of the fetched URL, the content type (e.g. image/png, application/pdf), and a ready-to-use data URI string (e.g. data:image/png;base64,...).

## Example request

```json
{
 "url": "https://www.example.com/"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "description": "URL to fetch and encode"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "base64": {
  "type": "string"
 },
 "data_uri": {
  "type": "string"
 },
 "size_bytes": {
  "type": "integer"
 },
 "content_type": {
  "type": "string"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-2ff678b8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
