---
title: "Apply the style of one image to another"
method: POST
path: "/v1/images/style-transfer"
tags: ["Images"]
---

# Apply the style of one image to another

`POST /v1/images/style-transfer`

## Request

- Base URL: `https://contentmaschine.ai/api`
- URL: `https://contentmaschine.ai/api/v1/images/style-transfer`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://contentmaschine.ai/api/oauth/authorize`, token URL `https://contentmaschine.ai/api/oauth/token`)

Re-renders the content image in the visual style of the style image.

Give each image either as a library file uuid (`file_uuid` for the content image,
`style_file_uuid` for the style reference) or INLINE as a base64 data URL
(`contentImage`, `styleImage`). One of each pair is required; sending both of a pair
is a 400. Returns when the image is ready; there is no job to poll.

## Request body

- object
  - `file_uuid` string, uuid: Uuid of a library image to restyle (the content image). Use this or `contentImage`.
  - `style_file_uuid` string, uuid: Uuid of a library image whose style is applied. Use this or `styleImage`.
  - `contentImage` string: Base64 data URL of the image to restyle. Use this or `file_uuid`.
  - `styleImage` string: Base64 data URL of the style reference. Use this or `style_file_uuid`.
  - `styleStrength` number, float: How strongly the style is applied.
  - `modelVariant` string: Model variant. Defaults to `standard`.
  - `modelOptions` object: Per-model options; see GET /v1/models.

## Response `200`

The restyled image.

- object
  - `success` boolean
  - `data` object
  - `timestamp` string, date-time

## Other responses

- `400`: A missing content or style image, both forms of one image, or an unusable image.
- `401`: Missing or invalid API key.
- `402`: Insufficient credits.
- `403`: A file uuid belongs to another user.
- `404`: A file uuid was not found.
- `default`: Any other error. Every failure this API emits uses the same envelope; branch on `error.type`, never on `error.message`, and quote `error.correlation_id` to support.

---

[API](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api.md) · [All operations](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api/revisions/28c74f46051c?raw)
