openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/dishis-tech/image
info:
  title: Image Hosting API
  version: 1.0.0
  description: Simple image hosting API. Flat pricing. No bandwidth limits. 510x
    cheaper than Cloudinary. Most APIs limit to 1020 MB. We give you 35 MB per
    image.
paths:
  /upload:
    post:
      summary: Upload an image
      description: Send an image as file, base64 string, or URL.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                  description: Image file, base64 data or URL (≤32 MB)
                name:
                  type: string
                  description: Optional filename or title hint
                expiration:
                  type: integer
                  minimum: 60
                  maximum: 15552000
                  description: Auto-delete time in seconds (60 – 15552000)
              required:
                - image
          application/json:
            schema:
              type: object
              properties:
                image:
                  type: string
                  description: base64 or URL representation
                name:
                  type: string
                expiration:
                  type: integer
              required:
                - image
      responses:
        "200":
          description: Image uploaded successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UploadResponse"
        4XX:
          description: Client or validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  status:
                    type: integer
        5XX:
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  status:
                    type: integer
    get:
      summary: Upload via GET (not recommended)
      description: Upload using query params. Limited by URL length.
      parameters:
        - name: image
          in: query
          required: true
          schema:
            type: string
          description: Base64 or image URL
        - name: name
          in: query
          schema:
            type: string
        - name: expiration
          in: query
          schema:
            type: integer
            minimum: 60
            maximum: 15552000
      responses:
        "200":
          description: Image uploaded (via GET)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UploadResponse"
    parameters:
      - description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
components:
  schemas:
    ImageInfo:
      type: object
      properties:
        filename:
          type: string
        name:
          type: string
        mime:
          type: string
        extension:
          type: string
        url:
          type: string
          format: uri
    UploadResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
            title:
              type: string
            url_viewer:
              type: string
              format: uri
            url:
              type: string
              format: uri
            display_url:
              type: string
              format: uri
            width:
              type: integer
            height:
              type: integer
            size:
              type: integer
            time:
              type: integer
            expiration:
              type: integer
            image:
              $ref: "#/components/schemas/ImageInfo"
            thumb:
              $ref: "#/components/schemas/ImageInfo"
            medium:
              $ref: "#/components/schemas/ImageInfo"
            delete_url:
              type: string
              format: uri
        success:
          type: boolean
        status:
          type: integer
security: {}
tags:
  - name: tools
    description: Operations related to tools
  - name: storage
    description: Operations related to storage
  - name: media
    description: Operations related to media
  - name: image
    description: Operations related to image
  - name: e-commerce
    description: Operations related to e-commerce
  - name: dev-tools
    description: Operations related to dev-tools
