# api2ls SVG to PNG Converter

> api2ls SVG to PNG Converter is a paid API for AI agents from api2ls.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Converts an SVG string to a PNG image at specified width and height dimensions

## Facts

- Endpoint: POST https://api2ls.com/api/svg2png
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api2ls-com-601a362c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_J9o-CvAKakPFkxPT8aFoU

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 api2ls-com-601a362c -d '<json body>'
```

Example prompt: Convert this SVG markup to a PNG image at 800 pixels wide and 600 pixels tall: <svg xmlns='http://www.w3.org/2000/svg'><circle cx='50' cy='50' r='40' fill='red'/></svg>

## When to prefer this

Use this endpoint when you need to programmatically rasterize SVG content to PNG at a specific resolution, especially within automated workflows where you have SVG markup as a string. Prefer this over client-side rendering when server-side consistency is required or the environment doesn't support SVG natively.

## Known failure modes

- Invalid or malformed SVG string — returns error indicating parsing failure
- Missing required fields (svg, width, height) — returns validation error
- Width or height values of zero or negative — may return error or empty image
- Extremely large dimensions may cause timeout or memory error
- Payment failure via x402 protocol — returns 402 Payment Required

## Output

Returns a PNG image file rendered from the provided SVG string at the specified width and height dimensions

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "svg",
  "width",
  "height"
 ],
 "properties": {
  "svg": {
   "type": "string"
  },
  "width": {
   "type": "number"
  },
  "height": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api2ls-com-601a362c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api2ls.com](https://www.zero.xyz/host/api2ls.com/llms.txt)
