MuseSpark
MuseSpark
Models & toolsTools

Image Converter API guide

Image Converter API: Convert an image to JPEG, PNG, or WebP. Set output_format to the target format.

Model overview

Convert an image to JPEG, PNG, or WebP. Set output_format to the target format.

API integration

DocumentationValue
API invocation identifierimage-converter
IntegrationAsync task API

Use this invocation identifier in API requests. Check your authorized model catalog for access. Follow the Quickstart for your first complete call.

Request parameters

Studio presets describe the form setup, not guaranteed server defaults. Send preset values explicitly to reproduce them.

imagestringNon-nullRequired

The URL of the input image.

Media types: image/*.

output_formatstringNon-nullOptional

The format of the output image.

Allowed values: "jpeg", "png", "webp".

Studio preset: "jpeg".

No parameters match. Clear the search or reset the filters.

Model rules

Parameter meaning

  • Choose the output format for the converted image. PNG supports transparency; JPEG is suited to photographic output where transparency is unnecessary.

Integration notes

Use the following field formats and values in MuseSpark requests.

  • output_format: MuseSpark exposes jpeg, png, and webp only; output_format is optional and Studio presets it to jpeg.

Request examples

Replace example media URLs and YOUR_... input identifiers with your own valid resources. Examples are checked against the exported item schema; media access and paid execution are separate runtime checks.

Set MUSESPARK_API_KEY and a stable MUSESPARK_REQUEST_ID before submitting. Preserve the request ID for retries of the same request and use a new ID for new work. Python examples use requests; JavaScript examples use Node.js 20 or later. The standalone Quickstart includes task polling and recovery.

Convert a product photo to WebP

curl --fail-with-body 'https://api.musespark.ai/api/v1/openapi/task' \
  -H "Authorization: Bearer $MUSESPARK_API_KEY" \
  -H "X-Idempotency-Key: $MUSESPARK_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "item_key": "image-converter",
  "parameters": {
    "output_format": "webp",
    "image": "https://example.com/product-photo.png"
  }
}'

Parameters used: output_format · image.

Choose PNG for a transparent asset

curl --fail-with-body 'https://api.musespark.ai/api/v1/openapi/task' \
  -H "Authorization: Bearer $MUSESPARK_API_KEY" \
  -H "X-Idempotency-Key: $MUSESPARK_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "item_key": "image-converter",
  "parameters": {
    "output_format": "png",
    "image": "https://example.com/transparent-logo.webp"
  }
}'

Parameters used: output_format · image.

Output

The output is the input image converted to the selected format.

Creation returns a task ID inside data. Poll that task until completion, then save data.result.output_urls and any data.result.batch_results. See the task lifecycle for terminal states, result retention, and errors.

Troubleshooting

A format such as AVIF or TIFF is rejected. This MuseSpark item accepts only jpeg, png, and webp.

output_format

A transparent input loses transparency after conversion. Choose png when you need to retain an alpha channel.

output_format

For rejected inputs, check the field type, accepted values, and conditional requirements in Request parameters and Model rules. Correct the affected fields before submitting again.

If creation times out, preserve the request identity and any known task ID. Follow Errors, timeouts and retries before submitting again.

The public input snapshot was exported on 2026-11-09. Current prices and availability are listed in the model center.