---
title: "Vectorize image"
method: POST
path: "/v1/images/vectorize"
tags: ["image"]
---

# Vectorize image

`POST /v1/images/vectorize`

## Request

- Base URL: `https://external.api.recraft.ai`
- URL: `https://external.api.recraft.ai/v1/images/vectorize`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/recraft/apis/recraft-ai-external-api/docs/v1/images/vectorize/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `image_format` 'webp' | 'png'
  - `response_format` 'url' | 'b64_json' | 'multipart'
  - `upscale` 'upscale4mp' | 'upscale16mp'
  - `zdr` boolean: Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.
  - `color_reduction` 'on' | 'off'
  - `limit_num_shapes` 'on' | 'off'
  - `max_num_colors` integer
  - `max_num_shapes` integer
  - `return_gradients` 'on' | 'off'
  - `shape_stacking` 'cut_out' | 'hierarchical'
  - `small_shape_filter` 'on' | 'off'
  - `strict_color_palette` array[]
    - integer[]
  - `svg_compression` 'on' | 'off'
  - `image_url` string: URL or data URL of the input image. JSON counterpart of the `image` file.

## Response `200`

OK

- ProcessImageResponse
  - `created` integer, required
  - `credits` integer, required
  - `image` Image, required
    - `b64_json` string
    - `image_id` string, uuid, required
    - `revised_prompt` string
    - `url` string

## Other responses

- `4XX`: Request failed. The body is plain text (for example 401 `request unauthorized`) or JSON, so read it as text before parsing.
- `5XX`: Request failed. The body is plain text (for example 401 `request unauthorized`) or JSON, so read it as text before parsing.

---

[API](https://skmtc.dev/recraft/apis/recraft-ai-external-api.md) - [All operations](https://skmtc.dev/recraft/apis/recraft-ai-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/recraft/apis/recraft-ai-external-api/revisions/2180aa45c034?raw)
