• Docs
  • API reference
  • SDKs & tools
  • Models
  • Changelog
Sign inGet an API key
DocsAPI referenceSDKs & toolsModelsChangelog

Start here

IntroductionGetting startedAuthenticationPricing and billingBeta

Concepts

TasksPrompts and imagesDestinationsWebhooksRate limits

Models

The model fieldChoosing an image modelVideo models

Guides

Generate imagesGenerate videoImage to imageEnhance prompts
Remove backgroundUpscale imagesAlt textReview imagesRate images
  1. Docs
  2. /
  3. Guides
  4. /
  5. Edit and analyze

Remove background

Turn one image into a cutout with a transparent background. No model or prompt to choose.

PreviousEnhance promptsNextUpscale images

On this page

FieldsWhat comes backPriceNext steps

POST /image/remove-background takes one image URL and returns a cutout with a transparent background. There is no model field and no prompt. Mynth picks the model and keeps it current.

import Mynth from "@mynthio/sdk";

const mynth = new Mynth();

const cutout = await mynth.image.removeBackground({
  url: "https://cdn.example.com/product.jpg",
  output: { format: "png" },
});

console.log(cutout.image.url);

Fields

FieldNotes
urlRequired. A public http(s) image URL
output.formatpng or webp. Both keep transparency. Omit it for the provider's format
destinationA destination name. See destinations
webhookPer-request URLs. See webhooks
metadataA JSON object up to 2048 bytes
generate_public_access_tokentrue returns a browser token as public_access_token. See from a browser

For a local file, pass file instead of url in the SDK, or a path in the CLI. Both upload it first.

What comes back

{
  "image": {
    "id": "img_Q8mZr2LkT0vWc5NhY7pD3xFa9GsJ1bEu",
    "url": "https://cdn.mynth.io/images/img_Q8mZr2LkT0vWc5NhY7pD3xFa9GsJ1bEu.png",
    "mynth_url": "https://cdn.mynth.io/images/img_Q8mZr2LkT0vWc5NhY7pD3xFa9GsJ1bEu.png",
    "size": "1024x1024",
    "format": "png"
  }
}

There is one image and no per-item status. If the work fails, the task is failed. With a destination, image also carries a destination block that says whether the upload worked. See destinations.

The create response includes a pat_ token, so a browser can poll this task the same way it polls a generation. See poll for results.

Price

$0.02 per image, held at create and charged when the task succeeds. See pricing.

Next steps

  • Destinations: write the cutout to your own storage.
  • Image to image: edits that need a prompt.