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

# Remove Image Background



## OpenAPI

````yaml https://api.mynth.io/openapi.json post /image/remove-background
openapi: 3.1.0
info:
  title: Mynth
  description: Mynth API
  version: 1.0.0
servers: []
security: []
paths:
  /image/remove-background:
    post:
      tags:
        - Image
      summary: Remove Image Background
      operationId: postImageRemoveBackground
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                access:
                  type: object
                  description: >-
                    Controls whether the create-task response should include a
                    short-lived Public Access Token.


                    That token can be passed to browser or client-side code for
                    polling task status and task images

                    without exposing your API key.
                  properties:
                    pat:
                      type: object
                      properties:
                        enabled:
                          type: boolean
                          default: true
                  required:
                    - pat
                destination:
                  type: string
                  examples:
                    - bunny-prod
                  maxLength: 64
                  minLength: 1
                metadata:
                  type: object
                output:
                  type: object
                  properties:
                    format:
                      enum:
                        - png
                        - webp
                webhook:
                  type: object
                  properties:
                    custom:
                      type: array
                      maxItems: 5
                      minItems: 1
                      items:
                        type: object
                        properties:
                          url:
                            type: string
                        required:
                          - url
                    dashboard:
                      type: boolean
                      description: >-
                        Set to false to disable dashboard-managed webhooks for
                        this task. Request-level custom webhooks are still sent.
              required:
                - url
              additionalProperties: false
      responses:
        '201':
          description: Image background removal task created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      estimatedCost:
                        type: string
                        description: >-
                          Estimated cost in USD reserved for this task. Failed
                          images are refunded, so the final cost may be lower.
                        examples:
                          - '0.03'
                      taskId:
                        type: string
                        description: Task ID
                        examples:
                          - tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP
                      access:
                        type: object
                        description: Returned when `access.pat.enabled` is true.
                        properties:
                          publicAccessToken:
                            type: string
                            description: >-
                              Short-lived Public Access Token for polling task
                              status and image results.


                              This token is safe to return to frontend code and
                              can be used instead of your API key for polling

                              public task state.
                            examples:
                              - pat_eyJhbGciOi...
                        required:
                          - publicAccessToken
                    required:
                      - estimatedCost
                      - taskId
                required:
                  - data
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: array
                    items: {}
                  data: {}
                required:
                  - success
                  - error
                  - data
      security:
        - apiKeyAuth: []
        - oauthAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: 'Mynth API key sent as `Authorization: Bearer <api-key>`.'
    oauthAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'OAuth access token sent as `Authorization: Bearer <access-token>`.'

````