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

# Proxy Image

> Proxy and transform images from decentralized storage protocols like Arweave and IPFS. This endpoint fetches images from `ar://`, `ipfs://`, or `https://` URLs and optionally resizes and converts them to a target format.

**Supported URL formats:**
- `ar://` - Arweave URLs (e.g., `ar://abc123...`)
- `ipfs://` - IPFS URLs (e.g., `ipfs://Qm...`)
- `https://` - Direct HTTPS URLs

Images are processed using sharp and can be resized and converted to WebP, AVIF, JPEG, or PNG formats. Responses are cached with immutable cache headers.

<Note>
  This endpoint is **public** and does not require authentication.
</Note>

## Overview

The Image Proxy API fetches and transforms images from decentralized storage protocols like Arweave and IPFS. It acts as a proxy that:

* Converts `ar://` and `ipfs://` URLs to fetchable gateway URLs
* Resizes images to specified dimensions without enlargement
* Converts images to optimized formats (WebP, AVIF, JPEG, PNG)
* Returns immutable cache headers for efficient caching

## Supported URL Formats

| Protocol | Format     | Example                         |
| -------- | ---------- | ------------------------------- |
| Arweave  | `ar://`    | `ar://abc123xyz...`             |
| IPFS     | `ipfs://`  | `ipfs://QmXyz...`               |
| HTTPS    | `https://` | `https://arweave.net/abc123...` |

## Image Transformation

When `w` (width) or `h` (height) parameters are provided, the image is resized to fit within the specified dimensions using the `inside` fit strategy, meaning:

* The image will never be enlarged beyond its original size
* Aspect ratio is preserved
* The image fits within the bounding box defined by `w` and `h`

## Example Usage

### Basic Request

```bash theme={null}
curl "https://api.inprocess.world/api/media/image?url=ar://your-arweave-tx-id"
```

### With Resize and Format Conversion

```bash theme={null}
curl "https://api.inprocess.world/api/media/image?url=ar://your-arweave-tx-id&w=400&h=400&f=webp&q=85"
```

### In an HTML Image Element

```html theme={null}
<img
  src="https://api.inprocess.world/api/media/image?url=ar://your-arweave-tx-id&w=600&f=webp"
  alt="Moment artwork"
/>
```


## OpenAPI

````yaml GET /media/image
openapi: 3.1.0
info:
  title: In•Process API
  description: >-
    The In•Process API enables browsing and managing moments from timelines.
    Retrieve moments from a specific artist's timeline, browse the in•process
    collective timeline, or filter by collection. The API supports creating
    moments, managing collections, handling payments, and interacting with the
    In•Process protocol ecosystem.
  version: 1.0.0
servers:
  - url: https://api.inprocess.world/api
    description: Production server
security: []
paths:
  /media/image:
    get:
      summary: Proxy Image
      description: >-
        Proxy and transform images from decentralized storage protocols like
        Arweave and IPFS. This endpoint fetches images from `ar://`, `ipfs://`,
        or `https://` URLs and optionally resizes and converts them to a target
        format.


        **Supported URL formats:**

        - `ar://` - Arweave URLs (e.g., `ar://abc123...`)

        - `ipfs://` - IPFS URLs (e.g., `ipfs://Qm...`)

        - `https://` - Direct HTTPS URLs


        Images are processed using sharp and can be resized and converted to
        WebP, AVIF, JPEG, or PNG formats. Responses are cached with immutable
        cache headers.
      operationId: proxyImage
      parameters:
        - name: url
          in: query
          description: >-
            The URL of the image to fetch. Supports Arweave (`ar://`), IPFS
            (`ipfs://`), and HTTPS URLs.
          required: true
          schema:
            type: string
          examples:
            arweave:
              summary: Arweave URL
              value: ar://abc123xyz...
            ipfs:
              summary: IPFS URL
              value: ipfs://QmXyz...
            https:
              summary: HTTPS URL
              value: https://arweave.net/abc123...
        - name: w
          in: query
          description: >-
            Target width in pixels. The image will be resized to fit within this
            width without enlargement.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 4096
        - name: h
          in: query
          description: >-
            Target height in pixels. The image will be resized to fit within
            this height without enlargement.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 4096
        - name: q
          in: query
          description: >-
            Image quality (1-100). Higher values produce better quality but
            larger files.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 80
        - name: f
          in: query
          description: Output image format.
          required: false
          schema:
            type: string
            enum:
              - webp
              - avif
              - jpeg
              - png
            default: webp
      responses:
        '200':
          description: Processed image returned
          headers:
            Content-Type:
              description: The MIME type of the output image
              schema:
                type: string
                example: image/webp
            Content-Length:
              description: The size of the image in bytes
              schema:
                type: integer
            Cache-Control:
              description: Caching directive for the response
              schema:
                type: string
                example: public, max-age=31536000, immutable
          content:
            image/*:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid or unsupported URL format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: error
                message: Invalid or unsupported URL format
        '500':
          description: Server error while processing image
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: error
                message: Failed to process image
      security: []
components:
  schemas:
    Error:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
          description: Error status
        message:
          type: string
          description: Error message
        errors:
          type: array
          description: >-
            Optional array of field-level validation errors. Typically included
            in 400 Bad Request responses for validation errors.
          items:
            type: object
            required:
              - field
              - message
            properties:
              field:
                type: string
                description: The field name that failed validation
              message:
                type: string
                description: The validation error message for this field

````