Unlimited-SVG API
Turn one bitmap (PNG / JPEG / WebP) into editable SVG code. After drawing, the text is checked against the original and mis-drawn words are corrected. $0.01 per image. OpenAI chat completions format, answered synchronously.
Endpoint
The same endpoint and key as the chat models. Put one picture (image_url) in messages; no prompt is needed, and any text you add is ignored. Any OpenAI SDK works with base_url set to https://api.apimodels.app/v1.
Code examples
Convert the KPI card from our review page and save it as a file.
curl https://api.apimodels.app/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "unlimited-svg",
"messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://apimodels.app/unlimited-svg-review/t6-kpi-original.webp"}}
]}]
}'from openai import OpenAI
client = OpenAI(base_url="https://api.apimodels.app/v1", api_key="YOUR_API_KEY")
resp = client.chat.completions.create(
model="unlimited-svg",
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://apimodels.app/unlimited-svg-review/t6-kpi-original.webp"}},
]}],
)
with open("kpi.svg", "w", encoding="utf-8") as f:
f.write(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apimodels.app/v1", apiKey: "YOUR_API_KEY" });
const resp = await client.chat.completions.create({
model: "unlimited-svg",
messages: [{ role: "user", content: [
{ type: "image_url", image_url: { url: "https://apimodels.app/unlimited-svg-review/t6-kpi-original.webp" } },
] }],
});
import { writeFileSync } from "node:fs";
writeFileSync("kpi.svg", resp.choices[0].message.content);Local pictures
Send local files as base64 data URIs.
import base64
from openai import OpenAI
client = OpenAI(base_url="https://api.apimodels.app/v1", api_key="YOUR_API_KEY")
b64 = base64.b64encode(open("logo.png", "rb").read()).decode()
resp = client.chat.completions.create(
model="unlimited-svg",
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}},
]}],
)
open("logo.svg", "w", encoding="utf-8").write(resp.choices[0].message.content)
print(resp.model_extra["svg"]) # {"width": 1000, "height": 750, "similarity": 0.92, "warnings": [], "text_fixes": []}Respuesta
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "unlimited-svg",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"750\" viewBox=\"0 128 1024 768\" ...>...</svg>"
},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0},
"svg": {
"width": 1000, "height": 750,
"similarity": 0.9203,
"warnings": [],
"text_fixes": []
},
"usage_units": {"images": 1, "cost_usd": 0.01}
}- choices[0].message.content is the complete SVG code, ready to save as a .svg file. Its width and height match the original.
- svg.similarity is how closely the rendered SVG matches the original (0–1); text_fixes lists the corrected text as [drawn, corrected] pairs; warnings are listed below.
- usage_units.images is always 1 and cost_usd is the amount actually charged (after any account discount). The token counts in usage are always 0.
- stream: true is accepted: the result arrives as one complete SSE chunk followed by [DONE].
Parámetros de la solicitud
| Field | Required | Type | Description |
|---|---|---|---|
| model | Yes | string | unlimited-svg |
| messages | Yes | array | Exactly one picture (image_url): PNG / JPEG / WebP and similar, up to 20MB and 40 megapixels. PDFs are not accepted. |
| text_check | No | boolean | Default true: OCR the original and correct mis-drawn text in the SVG. Turning it off is a little faster, but text may be wrong. |
| cjk_mode | No | string | "path" (default): corrected Chinese / Japanese lines are written as glyph outlines and look the same everywhere; "text": written as <text>, editable and smaller, but rendering depends on the viewer's fonts. |
warnings
| Field | Required | Type | Description |
|---|---|---|---|
| output_repaired | - | - | The SVG from the model was incomplete and has been closed automatically. Usable, but worth comparing with the original. |
| low_similarity | - | - | similarity is below 0.6: common for complex photos and dense textures. Photos are a poor fit for vectorising. |
| text_check_unavailable | - | - | The text check could not run this time; the SVG is returned unchecked (still billed at the same price). |
| cjk_text_unverified | - | - | The picture contains Chinese or Japanese, and some lines could not be verified. |
Billing
| Price | $0.01 per image |
| Billed unit | 1 image per successful call |
| Failures | Not charged |
Errores
- 400 — No picture, more than one, a link that cannot be downloaded or is not public, an unsupported format, or a PDF.
- 401 — Invalid API key.
- 402 — Insufficient balance.
- 413 — The file is over 20MB.
- 502 / 503 / 504 — Temporarily unavailable, or not finished within 15 minutes. Not charged; safe to retry.
See also
- Unlimited-SVG model page
- Unlimited-SVG hands-on review — real inputs and outputs: logos, charts, posters, a Chinese sale banner
- Unlimited-OCR-2 API
Preguntas frecuentes
How is the Unlimited-SVG API billed?
$0.01 per successful image, text check included. Failed calls are not charged.
What does the text check do?
After the SVG is drawn, the original picture is read with OCR and any mis-drawn words in the SVG are corrected; the fixes are listed in svg.text_fixes. It is on by default and can be turned off with text_check: false.
Which pictures work best?
Logos, icons, charts, flat illustrations, posters and banners. Photos and dense textures convert poorly; the response flags them with a low_similarity warning.