---
title: "Image to SVG"
method: POST
path: "/v1/svgs/vectorizations"
tags: ["Vectorize SVG"]
---

# Image to SVG

`POST /v1/svgs/vectorizations`

Converts an image input into an SVG output.

## Headers

- `x-trace-id` string — Optional client-supplied trace identifier. The API echoes this value in `X-Trace-ID` and includes it in request logs for client-side correlation.

## Request body

- VectorizeSVGRequest
  - `attributes` SvgAttributes, nullable — Optional SVG root attributes requested by the caller.
    - `viewBox` object, nullable — SVG root viewBox attribute controls.
      - `height` number, required — Height of the SVG viewBox. Must be greater than zero.
      - `minX` number, required — Minimum x coordinate of the SVG viewBox.
      - `minY` number, required — Minimum y coordinate of the SVG viewBox.
      - `width` number, required — Width of the SVG viewBox. Must be greater than zero.
  - `max_output_tokens` integer — Upper bound for output token count.
  - `model` string, required — Model identifier to use for generation or vectorization.
  - `presence_penalty` number, nullable — Penalty for tokens already present in prior output.
  - `stream` boolean — When true, emits a Server-Sent Events stream.
  - `temperature` number — Sampling temperature.
  - `top_p` number — Nucleus sampling probability.
  - `auto_crop` boolean — Auto-crop image to the dominant subject before vectorization.
  - `image` union, required — Image input reference. Accepts a network image URL or a base64-encoded image payload. Decoded images must be no larger than 12582912 bytes, 4096x4096 pixels, or 16777216 total pixels. Accepted direct media types: image/png, image/jpeg, image/webp, image/gif, image/svg+xml.
    - ImageInputReferenceUrl
      - `url` string, uri, required — Network image URL. Only http/https URLs are allowed. The API fetches the URL, follows up to 3 redirects, blocks private or reserved network targets, requires an image response content type, and applies the same decoded image limits as base64 inputs.
    - ImageInputReferenceBase64
      - `base64` string, required — Base64-encoded image payload. Decoded images must be no larger than 12582912 bytes, 4096x4096 pixels, or 16777216 total pixels. Accepted direct media types: image/png, image/jpeg, image/webp, image/gif, image/svg+xml.
  - `target_size` integer — Square resize target in pixels.

## Response `200`

When `stream` is false, returns `application/json` with the full SVG response. When `stream` is true, returns `text/event-stream` with Server-Sent Events. Each SSE message contains an `event:` line (`generating`, `reasoning`, `draft`, or `content`) and a `data:` line with a JSON payload. `usage` token fields are deprecated and set to `0`; use `credits` for billing values. For streaming, `credits` is emitted on completed `content` events. The stream terminates with `data: [DONE]`.

- SvgResponse
  - `created` integer, required
  - `credits` integer — Credit cost for this request. Use this for billing instead of `usage` tokens.
  - `data` SvgDocument[], required
    - `mime_type` 'image/svg+xml', required
    - `svg` string, required — Raw SVG markup.
  - `id` string, required
  - `usage` SvgUsage — Deprecated. Use `credits` for billing values.
    - `input_tokens` integer, required — Deprecated. Token counts are retained for compatibility and may be zeroed.
    - `output_tokens` integer, required — Deprecated. Token counts are retained for compatibility and may be zeroed.
    - `total_tokens` integer, required — Deprecated. Token counts are retained for compatibility and may be zeroed.

## Other responses

- `400` — Bad request – malformed body, missing required fields, or invalid parameter values.
- `401` — Unauthorized – missing, malformed, revoked, otherwise invalid API credentials, or an organization that could not be resolved for billing.
- `402` — Payment required – the organization has insufficient credits.
- `403` — Forbidden – the account is frozen, the request is not allowed, or content policy rejected the request.
- `404` — Not found – the requested model does not exist.
- `408` — Request timeout – the request exceeded an allowed client-facing deadline.
- `413` — Payload too large – the submitted prompt, image, or SVG input is too large.
- `429` — Rate limit exceeded – too many requests. The `code` field distinguishes the dimension: `rate_limit_exceeded` for the overall request rate, `operation_rate_limit_exceeded` for a single operation's throughput. Retry after the period indicated in the `Retry-After` header.
- `500` — The request could not be completed. Please retry.
- `502` — Bad gateway – model execution returned an invalid or failed response.
- `503` — Service unavailable – model execution is temporarily unavailable.
- `504` — Gateway timeout – model execution exceeded the server deadline.

## Changes

- **2026-08-22** `69b0cabf8827` — 1 breaking, 48 warning, 1 info
  - added `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5` to the response body `oneOf` list for the response status `200`
  - added the new `funding_payment_action_required` enum value to the `code` response property for the response status `400`
  - added the new `funding_payment_action_required` enum value to the `code` response property for the response status `401`
  - added the new `funding_payment_action_required` enum value to the `code` response property for the response status `402`
  - …46 more
- **2026-07-13** `bb992d04f546` — 1 breaking, 12 warning, 1 info
  - added `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5` to the response body `oneOf` list for the response status `200`
  - added the new `operation_rate_limit_exceeded` enum value to the `code` response property for the response status `400`
  - added the new `operation_rate_limit_exceeded` enum value to the `code` response property for the response status `401`
  - added the new `operation_rate_limit_exceeded` enum value to the `code` response property for the response status `402`
  - …10 more

[Change history](https://skmtc.dev/quiver/apis/quiverai-api/changes/v1/svgs/vectorizations/post.md)

---

[API](https://skmtc.dev/quiver/apis/quiverai-api.md) · [All operations](https://skmtc.dev/quiver/apis/quiverai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/quiver/quiverai-api/revisions/69b0cabf8827/schema)
