Image to SVG
Converts an image input into an SVG output.
POST
/v1/svgs/vectorizationsHeader parameters
x-trace-idstringOptional 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/jsonattributesSvgAttributes | nullOptional SVG root attributes requested by the caller.
Show propertiesHide properties
viewBoxobject | nullSVG root viewBox attribute controls.
Show propertiesHide properties
heightnumberrequiredHeight of the SVG viewBox. Must be greater than zero.
minXnumberrequiredMinimum x coordinate of the SVG viewBox.
minYnumberrequiredMinimum y coordinate of the SVG viewBox.
widthnumberrequiredWidth of the SVG viewBox. Must be greater than zero.
max_output_tokensintegerUpper bound for output token count.
min 1 · max 65536
modelstringrequiredModel identifier to use for generation or vectorization.
min length 1
presence_penaltynumber | nullPenalty for tokens already present in prior output.
min -2 · max 2 · default: 0
streambooleanWhen true, emits a Server-Sent Events stream.
default: false
temperaturenumberSampling temperature.
min 0 · max 2 · default: 1
top_pnumberNucleus sampling probability.
min 0 · max 1 · default: 1
auto_cropbooleanAuto-crop image to the dominant subject before vectorization.
default: false
imageImageInputReferencerequiredImage 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 propertiesHide properties
Any of:
ImageInputReferenceUrl
urlstring<uri>requiredNetwork 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
base64stringrequiredBase64-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_sizeintegerSquare 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]`.
createdintegerrequiredmin 0
creditsintegerCredit cost for this request. Use this for billing instead of `usage` tokens.
min 0
dataSvgDocument[]requiredmin items 1
Show propertiesHide properties
Array of
SvgDocumentmime_typestringrequiredAllowed:
image/svg+xmlsvgstringrequiredRaw SVG markup.
min length 1
idstringrequiredmin length 1
usageSvgUsagedeprecatedDeprecated. Use `credits` for billing values.
Show propertiesHide properties
input_tokensintegerrequireddeprecatedDeprecated. Token counts are retained for compatibility and may be zeroed.
min 0
output_tokensintegerrequireddeprecatedDeprecated. Token counts are retained for compatibility and may be zeroed.
min 0
total_tokensintegerrequireddeprecatedDeprecated. Token counts are retained for compatibility and may be zeroed.
min 0
400Bad request – malformed body, missing required fields, or invalid parameter values.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
401Unauthorized – missing, malformed, revoked, otherwise invalid API credentials, or an organization that could not be resolved for billing.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
402Payment required – the organization has insufficient credits.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
403Forbidden – the account is frozen, the request is not allowed, or content policy rejected the request.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
404Not found – the requested model does not exist.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
408Request timeout – the request exceeded an allowed client-facing deadline.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
413Payload too large – the submitted prompt, image, or SVG input is too large.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
429Rate limit exceeded – too many requests. Retry after the period indicated in the `Retry-After` header.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
500The request could not be completed. Please retry.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
502Bad gateway – model execution returned an invalid or failed response.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
503Service unavailable – model execution is temporarily unavailable.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 400 · max 599
504Gateway timeout – model execution exceeded the server deadline.
codestringrequiredAllowed:
invalid_requestinvalid_api_keyunauthorizedinsufficient_creditsaccount_frozencontent_policy_violationmodel_not_foundpayload_too_largerequest_timeoutrate_limit_exceededweekly_limit_exceededserver_errormodel_errormodel_unavailablemessagestringrequiredmin length 1
request_idstringrequiredmin length 1
statusintegerrequiredmin 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
}'const response = await fetch("https://api.quiver.ai/v1/svgs/vectorizations", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"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
})
});import requests
response = requests.post(
"https://api.quiver.ai/v1/svgs/vectorizations",
headers={
"Content-Type": "application/json"
},
json={
"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
}
}{
"code": "invalid_request",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 400
}{
"code": "unauthorized",
"message": "Unauthorized",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 401
}{
"code": "insufficient_credits",
"message": "Insufficient credits",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 402
}{
"code": "account_frozen",
"message": "Account is frozen",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 403
}{
"code": "model_not_found",
"message": "Model 'unknown-model' does not exist",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 404
}{
"code": "request_timeout",
"message": "Request timed out",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 408
}{
"code": "payload_too_large",
"message": "Payload too large",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 413
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please try again later.",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 429
}{
"code": "server_error",
"message": "The request could not be completed. Please retry.",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 500
}{
"code": "model_error",
"message": "The request could not be completed. Please retry.",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 502
}{
"code": "model_unavailable",
"message": "The request could not be completed. Please retry.",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 503
}{
"code": "request_timeout",
"message": "The request could not be completed. Please retry.",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 504
}