Codia
Vector Conversion API

Image to SVG API

Vectorize raster logos, icons, illustrations, and flat-art assets into scalable SVG files through a simple async API.

API pipeline
Image to SVG API
POST
Input
Raster image
PNG, JPG, GIF, or WebP URL/upload
Codia Open API
Vector path tracing
Auth
Queue
Result
Output
SVG asset
Scalable vector paths
Mode
Async polling
Credits
1 credit per successful conversion
Output
Downloadable SVG URL
POST /v2/open/svg_converter/create
curl 'https://api.codia.ai/v2/open/svg_converter/create' \
  -H 'Authorization: Bearer {codia_api_key}' \
  -H 'Content-Type: application/json' \
  --data '{
    "pic_url": "https://example.com/logo.png",
    "file_name": "logo.png"
  }'
Response
{
  "code": 0,
  "message": "ok",
  "data": {
    "record_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Built for production API workflows

Each Codia Open API shares the same authentication, billing, and operational model, so teams can add new visual conversion capabilities without new infrastructure.

Clean vector paths

Trace flat artwork into scalable SVG assets that stay crisp at any size.

Polling lifecycle

Submit once, poll for status, then download the completed SVG when ready.

Plan-aware limits

Read live dimension, file-size, and credit limits before users submit large assets.

Developer reference

The fields below are the pieces most teams need before wiring the API into a real product flow.

Endpoint
POST /v2/open/svg_converter/create
Polling endpoint
POST /v2/open/svg_converter/result/{record_id}
Content types
application/jsonmultipart/form-data
Input
PNG, JPG, GIF, or WebP URL/upload

Request fields

FieldTypeRequiredNotes
pic_url*string URLYesPublic URL of the raster image for JSON mode.
image*binaryYesImage file for multipart mode. The compatible field name file is also accepted.
file_namestringNoOriginal file name for record keeping and output naming.
record_id*uuidYesRequired only on GET /v2/open/svg_converter/result/{record_id} to poll the conversion result.

Response fields

FieldTypeRequiredNotes
record_id*uuidYesReturned by create; use it to poll GET /v2/open/svg_converter/result/{record_id}.
svg_convert_status*1 | 2 | 3YesConversion state: 1 complete, 2 failed, 3 doing.
svg_urlstring URLNoGenerated SVG download URL. Present when svg_convert_status is 1.

Integration flow

Build the happy path first, then add polling, retry, and terminal error handling around it. Async APIs should store the returned task or record ID before the user leaves the current screen.

1

Validate input

Check the user plan limits if your UI accepts direct uploads.

2

Create conversion

Submit the raster asset by URL or multipart upload and store the returned record ID.

3

Fetch the SVG

Poll the result endpoint and self-host the SVG once the conversion completes.

Copy-ready examples

Start with curl, then adapt the TypeScript or Python flow for your backend worker.

Submit with curl · bash
curl 'https://api.codia.ai/v2/open/svg_converter/create' \
  -H 'Authorization: Bearer {codia_api_key}' \
  -H 'Content-Type: application/json' \
  --data '{
    "pic_url": "https://example.com/logo.png",
    "file_name": "logo.png"
  }'

Limits and production notes

Limits

  • Supported inputs: PNG, JPG, GIF, and WebP.
  • Free plan: 512x512 max and 512 KB max file size.
  • Starter plan: 1024x1024 max and 2 MB max file size.
  • Pro plan: 2048x2048 max and 4 MB max file size.
  • Credits are consumed only after a successful conversion.
  • Add-on packs: 100 credits for $19.99, 200 credits for $29.99, or 500 credits for $49.99.

Implementation checklist

  • Call /v2/open/svg_converter/limit before upload if your UI accepts arbitrary user files.
  • Prefer simple logos, icons, and flat illustrations; photos usually produce less useful vectors.
  • Self-host the generated SVG if it becomes part of your product asset library.
  • Treat status 2 as terminal and ask the user for a cleaner input image.

Error handling

CodeMeaningWhat to do
400Invalid request body, missing required fields, unsupported file, or malformed URL.Validate input client-side and log the API response message for the failed request.
401Missing or invalid API key.Send Authorization: Bearer {codia_api_key}; rotate the key if validation keeps failing.
402Insufficient Open API credits.Stop retrying automatically and ask the workspace owner to top up or upgrade.
429Rate limit or concurrency limit reached.Retry with exponential backoff and a small amount of jitter.
500Temporary server-side failure.Retry idempotent polling calls; for submit calls, store your client request ID and avoid duplicate work.

Status values timeline

1

Complete; svg_url contains the converted SVG.

2

Failed; show a recoverable error to the user.

3

Doing; keep polling with backoff.

Where teams use it

Codia APIs are designed for applications that need visual understanding, asset conversion, and editable outputs at scale.

Recover missing source files for exported logos.

Convert product icons into scalable design-system assets.

Prepare flat artwork for print, signage, and high-density displays.

Automate vector cleanup inside asset ingestion pipelines.

Which API should you use?

Similar visual APIs solve different integration problems. Use this table to route users to the right endpoint.

APIBest forNot for
Image to SVGVectorizing logos, icons, marks, and flat artwork into scalable SVG files.Reconstructing full UI layout or editable design components.
Image to DSLTurning a screenshot into structured design data with layout and text objects.Producing a clean standalone vector asset from a logo.
Image LayeringSplitting one flat image into an editable stack of visual layers.Tracing crisp vector paths for icon systems.

Preise

Klare Preise für jedes Produkt. Starte kostenlos und wachse in deinem Tempo.

FAQ

Common implementation questions for Image to SVG API.

The API is optimized for logos, icons, illustrations, and flat-art graphics. Photographic images usually produce less useful SVGs.

Credits are charged on successful conversion completion, not when the task is submitted.

Yes. The create endpoint supports multipart upload with an image file as well as URL-based JSON requests.

All three APIs use the unified Codia Open API balance. You can subscribe to an Open API plan or buy add-on credits: 100 credits for $19.99, 200 credits for $29.99, or 500 credits for $49.99.

Build with Image to SVG API

Use one Codia Open API balance across visual structure, presentation conversion, vectorization, background removal, and image processing workflows.