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

# Upload Images for Remix

> Process one or more images from provided URLs. The API will download the images, apply transformations, and remove invisible watermarks.



## OpenAPI

````yaml POST /api/v1/image-rewrite
openapi: 3.1.0
info:
  title: Remix API
  description: >-
    TopYappers Remix API for processing video and image content. Provide public
    media URLs and optional transformation parameters to remove invisible
    watermarks and apply effects.
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://www.topyappers.com
security:
  - apiKeyAuth: []
paths:
  /api/v1/image-rewrite:
    post:
      summary: Process Images
      description: >-
        Process one or more images from provided URLs. The API will download the
        images, apply transformations, and remove invisible watermarks.
      operationId: processImages
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessImagesRequest'
      responses:
        '200':
          description: Images processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageRewriteSuccessResponse'
              examples:
                success:
                  summary: Successful batch processing
                  value:
                    success: true
                    message: Images processed successfully
                    data:
                      imageCount: 2
                      inputImageUrls:
                        - https://example.com/image-1.jpg
                        - https://example.com/image-2.jpg
                      parameters:
                        brightness: 0.02
                        contrast: 1.05
                        quality: 94
                      result:
                        metadata:
                          tool_time: 8.42
                          count: 2
                        data:
                          results:
                            - url: >-
                                https://imgrework.topyappers.com/processed-image-1.jpg
                              applied_params:
                                brightness: 0.02
                                contrast: 1.05
                                quality: 94
                            - url: >-
                                https://imgrework.topyappers.com/processed-image-2.jpg
                              applied_params:
                                brightness: 0.02
                                contrast: 1.05
                                quality: 94
                      processedImages:
                        - url: >-
                            https://imgrework.topyappers.com/processed-image-1.jpg
                          applied_params:
                            brightness: 0.02
                            contrast: 1.05
                            quality: 94
                        - url: >-
                            https://imgrework.topyappers.com/processed-image-2.jpg
                          applied_params:
                            brightness: 0.02
                            contrast: 1.05
                            quality: 94
                      appliedParameters:
                        - brightness: 0.02
                          contrast: 1.05
                          quality: 94
                        - brightness: 0.02
                          contrast: 1.05
                          quality: 94
                      processingTime: 8.42
        '400':
          description: Bad request - invalid image URLs or parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                noImages:
                  summary: No images provided
                  value:
                    error: >-
                      No images provided. Please provide image_url or an array
                      of images.
                tooManyImages:
                  summary: Too many images
                  value:
                    error: Maximum 20 images per batch allowed.
                invalidUrl:
                  summary: Invalid image URL
                  value:
                    error: Image at index 0 must have a valid HTTP/HTTPS image_url
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missingKey:
                  summary: Missing API key
                  value:
                    error: Missing API key. Please provide x-ty-api-key header.
                invalidKey:
                  summary: Invalid API key
                  value:
                    error: Invalid API key
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      x-codeSamples:
        - lang: typescript
          label: TypeScript
          source: |-
            async function processImages(
              imageUrls: string[],
              parameters: object,
              apiKey: string
            ): Promise<any> {
              const baseUrl = 'https://www.topyappers.com';

              const response = await fetch(`${baseUrl}/api/v1/image-rewrite`, {
                method: 'POST',
                headers: {
                  'x-ty-api-key': apiKey,
                  'Content-Type': 'application/json',
                },
                body: JSON.stringify({
                  images: imageUrls.map((imageUrl) => ({ image_url: imageUrl })),
                  parameters,
                }),
              });

              if (!response.ok) {
                throw new Error(`API error: ${response.status}`);
              }

              return await response.json();
            }

            // Usage
            const result = await processImages(
              ['https://example.com/image-1.jpg', 'https://example.com/image-2.jpg'],
              { brightness: 0.02, contrast: 1.05, quality: 94 },
              'YOUR_API_KEY'
            );
        - lang: python
          label: Python
          source: |-
            import requests

            API_KEY = "your-api-key-here"
            BASE_URL = "https://www.topyappers.com"
            IMAGE_URLS = [
                "https://example.com/image-1.jpg",
                "https://example.com/image-2.jpg"
            ]

            parameters = {
                "brightness": 0.02,
                "contrast": 1.05,
                "quality": 94
            }

            response = requests.post(
                f"{BASE_URL}/api/v1/image-rewrite",
                headers={
                    "x-ty-api-key": API_KEY,
                    "Content-Type": "application/json"
                },
                json={
                    "images": [{"image_url": url} for url in IMAGE_URLS],
                    "parameters": parameters
                }
            )

            if response.status_code == 200:
                result = response.json()
                print(f"Success: {result}")
            else:
                print(f"Error: {response.text}")
        - lang: shell
          label: cURL
          source: |-
            curl -X POST https://www.topyappers.com/api/v1/image-rewrite \
              -H "x-ty-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "images": [
                  { "image_url": "https://example.com/image-1.jpg" },
                  { "image_url": "https://example.com/image-2.jpg" }
                ],
                "parameters": {
                  "brightness": 0.02,
                  "contrast": 1.05,
                  "quality": 94
                }
              }'
components:
  schemas:
    ProcessImagesRequest:
      type: object
      description: >-
        Image processing request. Send either image_url for a single image or
        images for a batch of up to 20 images.
      properties:
        image_url:
          type: string
          format: uri
          description: Publicly accessible URL to a single image file
          example: https://example.com/image.jpg
        images:
          type: array
          minItems: 1
          maxItems: 20
          description: Batch of image URLs and optional image-specific parameters
          items:
            $ref: '#/components/schemas/ImageInput'
        parameters:
          $ref: '#/components/schemas/ImageProcessingParameters'
      anyOf:
        - required:
            - image_url
        - required:
            - images
      example:
        images:
          - image_url: https://example.com/image-1.jpg
          - image_url: https://example.com/image-2.jpg
        parameters:
          brightness: 0.02
          contrast: 1.05
          quality: 94
    ImageRewriteSuccessResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Images processed successfully
        data:
          type: object
          required:
            - imageCount
            - result
            - processedImages
          properties:
            imageCount:
              type: integer
              description: Number of images submitted for processing
              example: 2
            inputImageUrls:
              type: array
              items:
                type: string
                format: uri
              description: Input image URLs that were submitted
            parameters:
              $ref: '#/components/schemas/ImageProcessingParameters'
            result:
              $ref: '#/components/schemas/ImageRewriteBackendResult'
            processedImages:
              type: array
              items:
                $ref: '#/components/schemas/ImageRewriteOutput'
              description: Processed image URLs normalized for clients
            appliedParameters:
              type: array
              items:
                $ref: '#/components/schemas/ImageAppliedParams'
              description: Parameters applied to each processed image
            processingTime:
              type:
                - number
                - 'null'
              description: Processing time in seconds
              example: 8.42
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
    RateLimitError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Daily limit exceeded. Upgrade your plan or try in 24 hours.
        retryAfter:
          type: integer
          description: Number of seconds to wait before retrying
          example: 86400
        limit:
          type: integer
          description: Daily rate limit
          example: 100
      example:
        error: Daily limit exceeded. Upgrade your plan or try in 24 hours.
        retryAfter: 86400
        limit: 100
    ImageInput:
      allOf:
        - type: object
          required:
            - image_url
          properties:
            image_url:
              type: string
              format: uri
              description: Publicly accessible URL to the image file
              example: https://example.com/image.jpg
        - $ref: '#/components/schemas/ImageProcessingParameters'
    ImageProcessingParameters:
      type: object
      description: >-
        Optional image processing parameters. Global parameters apply to every
        image unless an image includes its own value.
      properties:
        zoomFactor:
          type: number
          minimum: 0.5
          maximum: 2
          default: 1
          description: Zoom level for the image
        saturation:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          description: Color saturation multiplier
        brightness:
          type: number
          minimum: -1
          maximum: 1
          default: 0
          description: Brightness adjustment
        contrast:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          description: Contrast multiplier
        hue:
          type: number
          minimum: -180
          maximum: 180
          default: 0
          description: Hue adjustment in degrees
        hueShift:
          type: number
          minimum: -180
          maximum: 180
          default: 0
          description: Alias for hue adjustment in degrees
        gamma:
          type: number
          minimum: 0.1
          maximum: 3
          default: 1
          description: Gamma correction value
        temperature:
          type: number
          minimum: 0.1
          maximum: 2
          default: 1
          description: Color temperature adjustment
        noise:
          type: number
          minimum: 0
          maximum: 0.5
          default: 0
          description: Amount of noise to add
        sharpness:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          description: Sharpness multiplier
        quality:
          type: integer
          minimum: 60
          maximum: 100
          default: 94
          description: Output image quality
        flipHorizontal:
          type: boolean
          default: false
          description: Whether to flip the image horizontally
        flipVertical:
          type: boolean
          default: false
          description: Whether to flip the image vertically
        deviceModel:
          type: string
          description: Target device profile for media metadata
          enum:
            - iPhone 17 Pro Max
            - iPhone 17 Pro
            - iPhone 17
            - iPhone 16 Pro Max
            - iPhone 16 Pro
            - iPhone 16
            - iPhone 15 Pro Max
            - iPhone 15 Pro
            - iPhone 15
            - iPhone 14 Pro Max
            - iPhone 14 Pro
            - iPhone 14
            - iPhone 13 Pro Max
            - iPhone 13 Pro
            - iPhone 13
            - Ray-Ban Meta Smart Glasses
      example:
        brightness: 0.02
        contrast: 1.05
        saturation: 1.03
        hue: 2
        quality: 94
        zoomFactor: 1.02
        deviceModel: iPhone 16 Pro
    ImageRewriteBackendResult:
      type: object
      properties:
        metadata:
          type: object
          properties:
            tool_time:
              type: number
              description: Processing time in seconds
              example: 8.42
            count:
              type: integer
              description: Number of images processed
              example: 2
        data:
          type: object
          properties:
            results:
              type: array
              items:
                $ref: '#/components/schemas/ImageRewriteOutput'
    ImageRewriteOutput:
      type: object
      required:
        - url
        - applied_params
      properties:
        url:
          type: string
          format: uri
          description: URL of the processed image file
          example: https://imgrework.topyappers.com/processed-image.jpg
        applied_params:
          $ref: '#/components/schemas/ImageAppliedParams'
    ImageAppliedParams:
      type: object
      description: The actual parameters that were applied to the image
      properties:
        brightness:
          type: number
        contrast:
          type: number
        saturation:
          type: number
        hue:
          type: number
        gamma:
          type: number
        temperature:
          type: number
        noise:
          type: number
        sharpness:
          type: number
        quality:
          type: integer
        zoom_factor:
          type: number
        device_model:
          type: string
          nullable: true
        flip_horizontal:
          type: boolean
        flip_vertical:
          type: boolean
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-ty-api-key
      description: API key for TopYappers API authentication

````