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

# Enhance an image from URL

> Enhances a single image hosted on an publicly accessible  URL, for example: https://sample-image.com/image.jpg

If your videos are stored on S3 or another provider, you can directly enhance images using this endpoint without needing to upload the image first.

> **⚠️ IMPORTANT:** Ensure that the image URL is either publicly accessible or [presigned](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html) if stored privately on S3 or similar platforms. For presigned URLs, we recommend setting the signature expiry to at least 2 hours to avoid potential access errors.

## Supported URLs

We support direct URLs to image resources only.

If the URL cannot be parsed as an image, the endpoint will return a status code of `400`.



## OpenAPI

````yaml https://backend.tensorpix.ai/api/schema/ post /api/images/enhance/from-url/
openapi: 3.1.0
info:
  title: TensorPix OpenAPI Documentation
  version: 1.1.0
  termsOfService: https://tensorpix.ai/terms-conditions
  contact:
    name: TensorPix Dev Team
    email: devs@tensorpix.ai
servers:
  - url: https://backend.tensorpix.ai
security: []
externalDocs:
  url: https://docs.tensorpix.ai
  description: Check out the full TensorPix documentation.
paths:
  /api/images/enhance/from-url/:
    post:
      tags:
        - images
      summary: Enhance an image from URL
      description: >-
        Enhances a single image hosted on an publicly accessible  URL, for
        example: https://sample-image.com/image.jpg


        If your videos are stored on S3 or another provider, you can directly
        enhance images using this endpoint without needing to upload the image
        first.


        > **⚠️ IMPORTANT:** Ensure that the image URL is either publicly
        accessible or
        [presigned](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html)
        if stored privately on S3 or similar platforms. For presigned URLs, we
        recommend setting the signature expiry to at least 2 hours to avoid
        potential access errors.


        ## Supported URLs


        We support direct URLs to image resources only.


        If the URL cannot be parsed as an image, the endpoint will return a
        status code of `400`.
      operationId: images_enhance_from_url_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UrlImageEnhancement'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UrlImageEnhancement'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UrlImageEnhancement'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnhancedImageUrl'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    UrlImageEnhancement:
      type: object
      properties:
        output_format:
          type: string
          description: 'Output image format. Possible values are: png, jpg, webp, jpeg.'
          maxLength: 10
        enhancement_type:
          type: string
          description: >-
            Type of image enhancement. Possible values are: underwaterCC,
            denoise, sr2x, sr4x, faceEnhance.
          maxLength: 50
        face_enhance:
          type: boolean
          description: Flag which enables or disables the Face Enhancer model.
        watermark:
          type: boolean
          description: >-
            Flag which denotes if the watermark will be added on the image. If
            enabled, the processing wont't deduct any Credits. Your account can
            process a limited number of watermarked images per day. See pricing
            for more details
        url:
          type: string
          format: uri
          description: >-
            URL of the to be enhanced image. The URL must be accessible.
            Example: https://dummyimage.com/600x400/000/fff
          maxLength: 1000
          minLength: 5
      required:
        - enhancement_type
        - face_enhance
        - output_format
        - url
        - watermark
    EnhancedImageUrl:
      type: object
      properties:
        enhanced_url:
          type: string
          format: uri
          description: >-
            Enhanced Image URL. Be aware the URL can expire. List enhanced
            images to get new URLs. Example: https://yoursite/imagename.jpg
        enhanced_img_id:
          type: string
          description: Enhanced image ID
      required:
        - enhanced_img_id
        - enhanced_url
    ValidationError:
      type: object
      properties:
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        non_field_errors:
          type: array
          items:
            type: string
      required:
        - errors
        - non_field_errors
    UnauthenticatedError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    GenericError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    ForbiddenError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    RateLimitError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````