Erase.bg - Background Remover

Erase.bg - Background Remover · Acciones GPT

Erase.BG Image Transformation Service

  • POST /uploadUpload file to Pixelbin

    Uploads a file to Pixelbin using the provided URL and other file details.

  • POST /transformTransform an asset using Pixelbin

    Applies transformations to a Pixelbin asset. Here, for example incase of background removal, string is erase.bg(), where the transformations plugin will be erase and name will be bg , similary for flip plugin = t and name = flip

  • GET /usageRetriev usage
  • GET /tokenRetrieve a token
  • POST /tokenSet a token
  • DELETE /tokenDeleted a token
Esquema original API
openapi: 3.0.0
info:
  title: Erase.BG Image Transformation Service
  version: 1.0.0
servers:
  - url: https://cdn.pixelbin.io/gpts
    description: Base URL of the API
paths:
  /upload:
    post:
      x-openai-isConsequential: true
      operationId: uploadToPixelbin
      summary: Upload file to Pixelbin
      description: Uploads a file to Pixelbin using the provided URL and other file details.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UploadRequest"
      responses:
        "200":
          description: Successfully uploaded the file to Pixelbin.
          content:
            application/json:
              schema:
                type: object
                properties:
                  pixelbin_url:
                    type: string
                    description: The URL of the uploaded file on Pixelbin.
        "400":
          description: Bad request.
        "500":
          description: Internal server error
  /transform:
    post:
      x-openai-isConsequential: false
      summary: Transform an asset using Pixelbin
      operationId: transformPixelbin
      description: Applies transformations to a Pixelbin asset. Here, for example incase of background removal, string is erase.bg(), where the transformations plugin will be erase and name will be  bg , similary for flip plugin = t and name = flip
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransformationRequest"
      responses:
        "200":
          description: Successfully transformed the asset.
          content:
            application/json:
              schema:
                type: string
                description: The URL of the transformed asset.
        "400":
          description: Bad request.
        "500":
          description: Internal server error
  /usage:
    get:
      summary: Retriev usage
      operationId: getUsage
      responses:
        "200":
          description: Usage Recieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    type: object
                    properties:
                      storage:
                        type: number
                    required:
                      - storage
                  credits:
                    type: object
                    properties:
                      used:
                        type: number
                    required:
                      - used
                  total:
                    type: object
                    properties:
                      storage:
                        type: number
                      credits:
                        type: number
        "400":
          description: Missing or invalid header
        "500":
          description: Internal server error
  /token:
    get:
      summary: Retrieve a token
      operationId: getToken
      responses:
        "200":
          description: Token retrieval successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
        "400":
          description: Missing or invalid header
        "500":
          description: Internal server error
    post:
      summary: Set a token
      operationId: setToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
              required:
                - token
      responses:
        "200":
          description: Token set successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        "400":
          description: Missing or invalid header or body
        "500":
          description: Internal server error
    delete:
      summary: Deleted a token
      operationId: logout
      responses:
        "200":
          description: You have been logged out successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  is_deleted:
                    type: boolean
        "400":
          description: Missing or invalid header or body
        "500":
          description: Internal server error
components:
  schemas:
    UploadRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: URL of the file to upload.
        name:
          type: string
          description: Name of the file.
        format:
          type: string
          description: Format of the file.
    KV:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
    TransformationRequest:
      type: object
      required:
        - pixelbin_url
        - transformations
      properties:
        pixelbin_url:
          type: string
          description: Pixelbin URL of the asset to transform.
        transformations:
          type: array
          description: List of transformations to apply.
          items:
            oneOf:
              - $ref: "#/components/schemas/EraseBackground"
              - $ref: "#/components/schemas/GenerateBackground"
    EraseBackground:
      type: object
      required:
        - plugin
        - name
      properties:
        plugin:
          type: string
          description: The transformation plugin name (erase).
          enum:
            - erase
        name:
          type: string
          description: The name of the transformation (always "bg" for erase).
        values:
          type: object
          properties:
            i:
              type: string
              description: Specifies the 'i' option for erase.
              enum:
                - car
                - ecommerce
                - general
                - human
            shadow:
              type: boolean
              description: Specifies whether to include a shadow (only for 'car').
            r:
              type: boolean
              description: Specifies whether to refine the image.

    GenerateBackground:
      type: object
      required:
        - plugin
        - name
      properties:
        plugin:
          type: string
          enum:
            - generate
        name:
          type: string
          description: The name of the transformation (always "bg" for generate).
          enum:
            - bg
        values:
          type: object
          properties:
            p:
              type: string
              description: Describe the background you want to generate.The value needs to be base64 encoded.
            focus:
              type: string
              description: Focus on the product or background
              enum: [Product, Background]
            np:
              type: string
              description: Negative prompt to filter out specific items
              example: "no birds"
            s:
              type: integer
              description: Seed for randomization (1-1000)
              minimum: 1
              maximum: 1000
              example: 133