---
title: "Text to SVG"
method: POST
path: "/v1/svgs/generations"
tags: ["Create SVGs"]
---

# Text to SVG

`POST /v1/svgs/generations`

Generates one or more SVGs from a prompt and optional references.

## 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

- GenerateSVGRequest
  - `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.
  - `instructions` string — Additional style or formatting guidance.
  - `n` integer — Number of outputs to generate.
  - `prompt` string, required — Primary text prompt that describes the desired SVG.
  - `references` ImageInputReferenceInput[] — Optional reference images to guide style/composition. Accepts `{ url }`, `{ base64 }`, or URL string shorthand. Runtime limits are model-specific: 4 for Arrow 1.1/Arrow 1.x aliases, 16 for Arrow 1.1 Max.
    - union
      - 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.
      - string, uri — String shorthand for a network image URL. Equivalent to `{ "url": "..." }`. The same URL safety and decoded image limits apply.

## 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. For `n > 1`, events are interleaved across outputs, each output keeps a stable `data.id`, and `data.index` indicates the output position. `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 – request throughput or measured input/output token usage exhausted a binding ceiling. `operation_rate_limit_exceeded` identifies operation throughput; `rate_limit_exceeded` covers overall request and token rates. `X-RateLimit-Dimension` names the exact dimension. When `Retry-After` is present, retry after the indicated period.
- `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-09-03** `bca7df4aa12f` — 1 breaking, 13 info
  - added `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5` to the response body `oneOf` list for the response status `200`
  - removed `subschema #1, subschema #2, subschema #3, subschema #4, subschema #5` from the response body `oneOf` list for the response status `200`
  - added the optional property `retry_after` to the response with the `400` status
  - added the optional property `retry_after` to the response with the `401` status
  - …10 more
- **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
- …earlier changes not shown

[Full history](https://skmtc.dev/quiver/apis/quiverai-api/changes/v1/svgs/generations/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/bca7df4aa12f/schema)
