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

# Inpaint

> Removes the areas marked on a mask and fills them in seamlessly to match the surrounding image. The result keeps the dimensions and format of the input image.<br/><br/> **Modes:**
  - `fast` (default, 5 credits): quickest results at the lowest cost
  - `generative` (10 credits): higher-quality fill with more realistic detail
<br/><br/> **Input Image Limits:**
  - Max size: 25MB
  - Min resolution: 64x64px
  - Max resolution: 4096x4096px
  - Supported formats: JPEG, PNG
<br/><br/> **Mask Requirements:**
  - Max size: 25MB
  - Supported formats: JPEG, PNG
  - Same dimensions as the input image
  - White marks the area to remove; black is kept unchanged
  - Transparency is ignored; only the color of each pixel counts




## OpenAPI

````yaml POST /v1/inpaint
openapi: 3.1.0
info:
  description: >-
    The Pixelcut API specification, learn more about the API at at
    https://www.pixelcut.ai/docs
  version: 0.0.2
  title: Pixelcut API
  termsOfService: >-
    https://pixelcut.notion.site/Pixelcut-API-Terms-of-Service-11b3b550490080d89a91e943d010efdf
  contact:
    name: API Support
    email: api@pixelcut.ai
servers:
  - url: https://api.developer.pixelcut.ai
    description: Pixelcut API server
security: []
paths:
  /v1/inpaint:
    post:
      tags:
        - Endpoints
      summary: Inpaint
      description: >
        Removes the areas marked on a mask and fills them in seamlessly to match
        the surrounding image. The result keeps the dimensions and format of the
        input image.<br/><br/> **Modes:**
          - `fast` (default, 5 credits): quickest results at the lowest cost
          - `generative` (10 credits): higher-quality fill with more realistic detail
        <br/><br/> **Input Image Limits:**
          - Max size: 25MB
          - Min resolution: 64x64px
          - Max resolution: 4096x4096px
          - Supported formats: JPEG, PNG
        <br/><br/> **Mask Requirements:**
          - Max size: 25MB
          - Supported formats: JPEG, PNG
          - Same dimensions as the input image
          - White marks the area to remove; black is kept unchanged
          - Transparency is ignored; only the color of each pixel counts
      operationId: inpaint
      parameters:
        - in: header
          name: Accept
          required: false
          schema:
            type: string
          description: >-
            Acceptable response media type(s). `application/json`, `image/*`.
            Default is `application/json`.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
                - mask_url
              properties:
                image_url:
                  $ref: '#/components/schemas/ImageURLParameter'
                mask_url:
                  $ref: '#/components/schemas/MaskURLParameter'
                mode:
                  $ref: '#/components/schemas/InpaintModeParameter'
          multipart/form-data:
            schema:
              type: object
              properties:
                image_url:
                  $ref: '#/components/schemas/ImageURLParameter'
                image:
                  $ref: '#/components/schemas/BinaryImageParameter'
                mask_url:
                  $ref: '#/components/schemas/MaskURLParameter'
                mask:
                  $ref: '#/components/schemas/BinaryMaskParameter'
                mode:
                  $ref: '#/components/schemas/InpaintModeParameter'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SameTypeAsRequestJSONResponse'
            image/*:
              schema:
                $ref: '#/components/schemas/SameTypeAsRequestBinaryResponse'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
      security:
        - ApiKeyAuth: []
        - OAuth2:
            - pixa:write
components:
  schemas:
    ImageURLParameter:
      type: string
      format: url
      description: URL of the image to be processed.
      example: https://cdn3.pixelcut.app/product.jpg
    MaskURLParameter:
      type: string
      format: url
      description: >-
        URL of the mask. It must have the same dimensions as the input image.
        White pixels mark the area to process; black pixels are kept.
      example: https://cdn3.pixelcut.app/product-mask.png
    InpaintModeParameter:
      type: string
      enum:
        - generative
        - fast
      default: fast
      description: >-
        `fast` (5 credits): quickest results at the lowest cost. `generative`
        (10 credits): higher-quality fill with more realistic detail.
    BinaryImageParameter:
      type: string
      format: binary
      description: >-
        Binary file of the image to be processed, this is mutually exclusive
        with image_url, if both are provided the image will be used.
    BinaryMaskParameter:
      type: string
      format: binary
      description: >-
        Binary file of the mask, this is mutually exclusive with mask_url, if
        both are provided the mask will be used. It must have the same
        dimensions as the input image. White pixels mark the area to process;
        black pixels are kept.
    SameTypeAsRequestJSONResponse:
      type: object
      properties:
        result_url:
          type: string
          description: >-
            A URL to access the resultant image. The file is deleted after at
            most 24 hours. File format will be the same as the input format.
          example: >-
            https://assets.pixelcut.app/public/result/a16646be-91c8-4e3a-b359.jpg
    SameTypeAsRequestBinaryResponse:
      type: string
      format: binary
      properties:
        image:
          description: >-
            Resultant image in binary format. The file format will be the same
            as the input format.
  responses:
    Error400:
      description: >-
        The input could not be processed, often returned when the input image
        exceeds API limits.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: A description of the error.
                example: File size too large
              error_code:
                type: string
                enum:
                  - invalid_request_body
                  - missing_parameter
                  - invalid_parameter
                  - unsupported_content_type
                  - malformed_image
                  - unsupported_image_format
                  - file_size_too_large
                  - resolution_too_high
                  - unknown_foreground
                example: file_size_too_large
                description: >
                  The error codes provide a way to programmatically handle
                  errors.  


                  The following error codes are currently in use:  

                  - `invalid_request_body`: The request body was empty or
                  invalid.

                  - `missing_parameter`: A required parameter was not provided.

                  - `invalid_parameter`: A parameter was provided but it was
                  invalid.

                  - `unsupported_content_type`: The content type of the request
                  was not application/json or multipart/form-data.

                  - `malformed_image`: The image could not be decoded.

                  - `unsupported_image_format`: The image format is not
                  supported.

                  - `file_size_too_large`: The image file size is too large.

                  - `resolution_too_high`: The image resolution is too high.

                  - `unknown_foreground`: The foreground subject of the image
                  could not be detected.
    Error401:
      description: The authentication token is missing or invalid.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: API Token not found
              error_code:
                type: string
                enum:
                  - invalid_auth_token
    Error403:
      description: >-
        Returned when you have insufficient credits to perform the requested
        action.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Insufficient credits available
              error_code:
                type: string
                enum:
                  - insufficient_api_credits
    Error429:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Too many requests
              error_code:
                type: string
                enum:
                  - rate_limit_exceeded
    Error500:
      description: Internal service error
  securitySchemes:
    ApiKeyAuth:
      description: >
        All API requests require a valid api key. Include your token as a HTTP
        request header in the following format: `X-API-Key: skXXXXXXXXXXXXXXXX`.
        You can obtain an api key by signing up for developer access in your
        Pixelcut account.
      type: apiKey
      name: X-API-KEY
      in: header
    OAuth2:
      description: >
        OAuth 2.0 authorization code flow, used by MCP clients and third-party
        integrations acting on a user's behalf. Request the narrowest scope your
        integration needs.
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://oauth.pixelcut.ai/oauth/authorize
          tokenUrl: https://oauth.pixelcut.ai/oauth/token
          refreshUrl: https://oauth.pixelcut.ai/oauth/token
          scopes:
            pixa:read: >-
              Read account state — credit balance, job status, and previously
              generated assets.
            pixa:write: Submit editing and generation jobs that consume credits.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.