Skip to content
Esc
navigateopen⌘Jpreview

Image to SVG

Converts an image input into an SVG output.

POST/v1/svgs/vectorizations
Header parameters
x-trace-idstring
Optional client-supplied trace identifier. The API echoes this value in `X-Trace-ID` and includes it in request logs for client-side correlation.
min length 1 · max length 256
Request body
requiredapplication/json
attributesSvgAttributes | null
Optional SVG root attributes requested by the caller.
Show properties
viewBoxobject | null
SVG root viewBox attribute controls.
Show properties
heightnumberrequired
Height of the SVG viewBox. Must be greater than zero.
minXnumberrequired
Minimum x coordinate of the SVG viewBox.
minYnumberrequired
Minimum y coordinate of the SVG viewBox.
widthnumberrequired
Width of the SVG viewBox. Must be greater than zero.
max_output_tokensinteger
Upper bound for output token count.
min 1 · max 65536
modelstringrequired
Model identifier to use for generation or vectorization.
min length 1
presence_penaltynumber | null
Penalty for tokens already present in prior output.
min -2 · max 2 · default: 0
streamboolean
When true, emits a Server-Sent Events stream.
default: false
temperaturenumber
Sampling temperature.
min 0 · max 2 · default: 1
top_pnumber
Nucleus sampling probability.
min 0 · max 1 · default: 1
auto_cropboolean
Auto-crop image to the dominant subject before vectorization.
default: false
imageImageInputReferencerequired
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.
Show properties
Any of:
ImageInputReferenceUrl
urlstring<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
base64stringrequired
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.
min length 1 · max length 16777216
target_sizeinteger
Square resize target in pixels.
min 128 · max 4096
Responses
200When `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]`.
createdintegerrequired
min 0
creditsinteger
Credit cost for this request. Use this for billing instead of `usage` tokens.
min 0
dataSvgDocument[]required
min items 1
Show properties
Array of SvgDocument
mime_typestringrequired
Allowed:image/svg+xml
svgstringrequired
Raw SVG markup.
min length 1
idstringrequired
min length 1
usageSvgUsagedeprecated
Deprecated. Use `credits` for billing values.
Show properties
input_tokensintegerrequireddeprecated
Deprecated. Token counts are retained for compatibility and may be zeroed.
min 0
output_tokensintegerrequireddeprecated
Deprecated. Token counts are retained for compatibility and may be zeroed.
min 0
total_tokensintegerrequireddeprecated
Deprecated. Token counts are retained for compatibility and may be zeroed.
min 0
400Bad request – malformed body, missing required fields, or invalid parameter values.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
401Unauthorized – missing, malformed, revoked, otherwise invalid API credentials, or an organization that could not be resolved for billing.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
402Payment required – the organization has insufficient credits.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
403Forbidden – the account is frozen, the request is not allowed, or content policy rejected the request.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
404Not found – the requested model does not exist.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
408Request timeout – the request exceeded an allowed client-facing deadline.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
413Payload too large – the submitted prompt, image, or SVG input is too large.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
429Rate limit exceeded – too many requests. Retry after the period indicated in the `Retry-After` header.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
500The request could not be completed. Please retry.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
502Bad gateway – model execution returned an invalid or failed response.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
503Service unavailable – model execution is temporarily unavailable.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
504Gateway timeout – model execution exceeded the server deadline.
codestringrequired
Allowed:invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailable
messagestringrequired
min length 1
request_idstringrequired
min length 1
statusintegerrequired
min 400 · max 599
Request
curl -X POST "https://api.quiver.ai/v1/svgs/vectorizations" \
  -H "Content-Type: application/json" \
  -d '{
  "attributes": {
    "viewBox": {
      "height": 512,
      "minX": 0,
      "minY": 0,
      "width": 512
    }
  },
  "max_output_tokens": 4096,
  "model": "arrow-1.1",
  "presence_penalty": 0.2,
  "stream": false,
  "temperature": 0.4,
  "top_p": 0.95,
  "auto_crop": true,
  "image": {
    "url": "https://example.com/uploads/reference1.png"
  },
  "target_size": 1024
}'
Response
{
  "created": 1704067200,
  "credits": 1,
  "data": [
    {
      "mime_type": "image/svg+xml",
      "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2l8 20H4z\"/></svg>"
    }
  ],
  "id": "resp_01J9AZ3XJ7D5S9ZV2Q5Z8E1A4N",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0
  }
}