> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goenhance.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Background Remover

> Remove the background from an image and get a cutout PNG at the original size. Soft edges such as hair and fur keep their partial transparency, and the old background colour is cleaned out of those edges, so the cutout does not show a halo when you place it on a new background.

**Pricing:** 0.5 tokens per image (= $0.01), regardless of image size or `image_type`.

**Choosing `image_type`:**
- `general` (default): photos of people, products, animals and objects.
- `anime`: anime characters and illustrations. Do not use it for real photos: it is tuned for artwork and breaks hair into fragments on photographs.

**Input and output:**
- `image_url` must be an `https://` link that is publicly reachable, at most 50 MB and at most 36 megapixels.
- The output is always a PNG with the same width and height as the input. Without `background_color` the background is transparent; with `background_color` the subject is placed on that solid colour.
- The model keeps the most prominent subject. With `anime`, items the character holds and props next to it are usually kept as part of the subject.
- Transparent or see-through objects (glass, smoke, water) are the hardest case and may come out incomplete.

Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use `custom_callback_url`) to get the cutout.



## OpenAPI

````yaml api-reference/image-api/openapi-background-remover.json POST /api/v1/images/generations
openapi: 3.1.0
info:
  title: GoEnhance API - Background Remover
  description: Background Remover
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/images/generations:
    post:
      tags:
        - ImageAPI
      summary: Background Remover
      description: >-
        Remove the background from an image and get a cutout PNG at the original
        size. Soft edges such as hair and fur keep their partial transparency,
        and the old background colour is cleaned out of those edges, so the
        cutout does not show a halo when you place it on a new background.


        **Pricing:** 0.5 tokens per image (= $0.01), regardless of image size or
        `image_type`.


        **Choosing `image_type`:**

        - `general` (default): photos of people, products, animals and objects.

        - `anime`: anime characters and illustrations. Do not use it for real
        photos: it is tuned for artwork and breaks hair into fragments on
        photographs.


        **Input and output:**

        - `image_url` must be an `https://` link that is publicly reachable, at
        most 50 MB and at most 36 megapixels.

        - The output is always a PNG with the same width and height as the
        input. Without `background_color` the background is transparent; with
        `background_color` the subject is placed on that solid colour.

        - The model keeps the most prominent subject. With `anime`, items the
        character holds and props next to it are usually kept as part of the
        subject.

        - Transparent or see-through objects (glass, smoke, water) are the
        hardest case and may come out incomplete.


        Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use
        `custom_callback_url`) to get the cutout.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - background-remover
                  description: Model name. Must be `background-remover`.
                image_url:
                  type: string
                  format: uri
                  minLength: 1
                  description: >-
                    URL of the image to cut out. Must be an `https://` link that
                    is publicly reachable, at most 50 MB and at most 36
                    megapixels.
                image_type:
                  type: string
                  enum:
                    - general
                    - anime
                  default: general
                  description: >-
                    What kind of image it is. `general` (default) for photos;
                    `anime` for anime characters and illustrations only, since
                    it breaks hair into fragments on real photos.
                background_color:
                  type: string
                  pattern: ^#?[0-9a-fA-F]{6}$
                  description: >-
                    Optional. A hex colour such as `#FFFFFF`. When set, the
                    subject is placed on this solid colour and the PNG has no
                    transparency. When omitted, the background is transparent.
                  example: '#FFFFFF'
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - model
                - image_url
            example:
              model: background-remover
              image_url: https://your-cdn.com/photo.jpg
              image_type: general
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                      cost:
                        type: number
                        description: >-
                          Tokens deducted for this request. This is the amount
                          actually charged, so it already reflects any discount
                          active on your account and can be lower than the
                          listed price. Tokens are deducted when the task is
                          accepted, and refunded automatically if the generation
                          ends in failure.
                        example: 0.5
                    required:
                      - img_uuid
                      - cost
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                      cost: 0.5
                '2':
                  summary: Image URL is not https
                  value:
                    code: -1
                    msg: image_url must be an https:// link
                '3':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
                invalid_type:
                  summary: Unknown image_type
                  value:
                    code: -1
                    msg: 'image_type must be one of: general, anime'
                quota:
                  summary: API key quota exceeded
                  value:
                    code: 101
                    msg: 'API key quota exceeded: 4990 of 5000 tokens used (monthly)'
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
          headers: {}
      deprecated: false
      security: []

````