# Upload Files

### Supported Formats

<table><thead><tr><th width="184.09326171875">Type</th><th>Formats</th></tr></thead><tbody><tr><td><strong>Images</strong></td><td><code>JPG</code>, <code>JPEG</code>, <code>PNG</code>, <code>WebP</code>, <code>GIF</code>, <code>BMP</code>, <code>TIFF</code></td></tr><tr><td><strong>Videos</strong></td><td><code>MP4</code>, <code>AVI</code>, <code>MOV</code>, <code>WMV</code>, <code>FLV</code>, <code>WebM</code>, <code>MKV</code>, <code>3GP</code>, <code>OGV</code></td></tr><tr><td><strong>Audio</strong></td><td><code>MP3</code>, <code>WAV</code>, <code>OGG</code>, <code>AAC</code>, <code>FLAC</code>, <code>WebM</code>, <code>M4A</code>, <code>Opus</code></td></tr></tbody></table>

> **Note:** For files larger than 50MB, we recommend using a URL input instead of uploading directly.

> **Note:** A single account is permitted to upload up to 1,000 assets, if you require a higher limit, please contact <support@inforn.ai>.

### 1. Upload resources

<table><thead><tr><th width="184.09326171875">Field</th><th>Required</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><strong>model</strong></td><td><code>True</code></td><td>string</td><td>-</td><td>Model id</td></tr><tr><td><strong>file</strong></td><td><code>True</code></td><td>file/string</td><td>-</td><td><code>Local file stream</code> or <code>remote resource URL</code> (only http/https supported).</td></tr></tbody></table>

{% tabs %}
{% tab title="multipart/form-data" %}

```bash
curl -X POST 'https://media.onerouter.pro/v1/upload/resources' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'model=bytedance/seedance-2.0/virtual-portrait-reference-to-video' \
  -F 'file=@/tmp/person-front.png;type=image/png'
```

{% endtab %}

{% tab title="application/json" %}

```bash
curl -X POST 'https://media.onerouter.pro/v1/upload/resources' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "bytedance/seedance-2.0/virtual-portrait-reference-to-video",
    "file": "https://example.com/person-side.png"
  }'
```

{% endtab %}
{% endtabs %}

Response

```json
{
  "code": 200,
  "data": {
    "id": 2,
    "upstream_asset_uri": "asset://asset-20260606170356-s9vrz",
    "upstream_status": "Processing",
    "asset_type": "Image",
    "description": "",
    "upload_source": "remote_url",
    "source_url": "https://storage.googleapis.com/infron_gcs/image%2Fplayground-inputs%2F15%2F20260606%2Fcde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
    "gcs_url": "https://storage.googleapis.com/infron_gcs/image%2Fmodel-assets%2Fseedance%2F13%2F20260606%2Fb97f550f-7309-41ba-b7a4-585bb43d97e9.jpg",
    "file_name": "cde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
    "content_type": "image/jpeg",
    "file_ext": ".jpg",
    "file_size_bytes": 39383,
    "sha256_hash": "e7d916a106671814609f2ecb3b57ae1afd048df21a8c7c131f4035918cef2cdc",
    "status": "processing",
    "last_polled_at": "2026-06-06T09:03:55.754111989Z",
    "created_at": "2026-06-06T09:03:55.755Z",
    "updated_at": "2026-06-06T09:03:55.755Z"
  },
  "message": "success"
}
```

### 2. List resources

<table><thead><tr><th width="184.09326171875">Field</th><th>Required</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><strong>page</strong></td><td><code>False</code></td><td>number</td><td><code>1</code></td><td>Page index</td></tr><tr><td><strong>page_size</strong></td><td><code>False</code></td><td>number</td><td><code>20</code></td><td>Number of items per page, maximum 100</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://media.onerouter.pro/v1/list/resources?page=1&page_size=20' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

{% endtab %}
{% endtabs %}

Response

```json
{
  "code": 200,
  "data": {
    "items": [
      {
        "id": 2,
        "upstream_asset_uri": "asset://asset-20260606170356-s9vrz",
        "upstream_status": "Active",
        "asset_type": "Image",
        "description": "",
        "upload_source": "remote_url",
        "source_url": "https://storage.googleapis.com/infron_gcs/image%2Fplayground-inputs%2F15%2F20260606%2Fcde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
        "gcs_url": "https://storage.googleapis.com/infron_gcs/image%2Fmodel-assets%2Fseedance%2F13%2F20260606%2Fb97f550f-7309-41ba-b7a4-585bb43d97e9.jpg",
        "file_name": "cde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
        "content_type": "image/jpeg",
        "file_ext": ".jpg",
        "file_size_bytes": 39383,
        "sha256_hash": "e7d916a106671814609f2ecb3b57ae1afd048df21a8c7c131f4035918cef2cdc",
        "status": "active",
        "last_polled_at": "2026-06-06T09:05:01Z",
        "active_at": "2026-06-06T09:05:01Z",
        "created_at": "2026-06-06T09:03:56Z",
        "updated_at": "2026-06-06T09:05:01Z"
      },
      {
        "id": 1,
        "upstream_asset_uri": "asset://asset-20260606170301-mfcb4",
        "upstream_status": "Active",
        "asset_type": "Image",
        "description": "",
        "upload_source": "remote_url",
        "source_url": "https://storage.googleapis.com/infron_gcs/image%2Fplayground-inputs%2F15%2F20260606%2Fcde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
        "gcs_url": "https://storage.googleapis.com/infron_gcs/image%2Fmodel-assets%2Fseedance%2F13%2F20260606%2F522c8572-b290-4e82-978a-1998ea5ac5c5.jpg",
        "file_name": "cde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
        "content_type": "image/jpeg",
        "file_ext": ".jpg",
        "file_size_bytes": 39383,
        "sha256_hash": "e7d916a106671814609f2ecb3b57ae1afd048df21a8c7c131f4035918cef2cdc",
        "status": "active",
        "last_polled_at": "2026-06-06T09:05:01Z",
        "active_at": "2026-06-06T09:05:01Z",
        "created_at": "2026-06-06T09:03:01Z",
        "updated_at": "2026-06-06T09:05:01Z"
      }
    ],
    "total": 2,
    "page": 1,
    "page_size": 20
  },
  "message": "success"
}
```

### 3. Check resource status

<table><thead><tr><th width="184.09326171875">Field</th><th>Required</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><strong>id</strong></td><td><code>True</code></td><td>number</td><td>-</td><td>Resource id</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://media.onerouter.pro/v1/status/resources/{id}' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

{% endtab %}
{% endtabs %}

Response

{% tabs %}
{% tab title="status=Active" %}

```json
{
  "code": 200,
  "data": {
    "id": 2,
    "upstream_asset_uri": "asset://asset-20260606170356-s9vrz",
    "upstream_status": "Active",
    "asset_type": "Image",
    "description": "",
    "upload_source": "remote_url",
    "source_url": "https://storage.googleapis.com/infron_gcs/image%2Fplayground-inputs%2F15%2F20260606%2Fcde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
    "gcs_url": "https://storage.googleapis.com/infron_gcs/image%2Fmodel-assets%2Fseedance%2F13%2F20260606%2Fb97f550f-7309-41ba-b7a4-585bb43d97e9.jpg",
    "file_name": "cde00456-aebc-453b-a1e3-8cafebe0a457.jpg",
    "content_type": "image/jpeg",
    "file_ext": ".jpg",
    "file_size_bytes": 39383,
    "sha256_hash": "e7d916a106671814609f2ecb3b57ae1afd048df21a8c7c131f4035918cef2cdc",
    "status": "active",
    "last_polled_at": "2026-06-06T09:05:01Z",
    "active_at": "2026-06-06T09:05:01Z",
    "created_at": "2026-06-06T09:03:56Z",
    "updated_at": "2026-06-06T09:05:01Z"
  },
  "message": "success"
}
```

{% endtab %}

{% tab title="status=Processing" %}

```json
{
  "code": 200,
  "data": {
    "id": 4,
    "upstream_asset_uri": "asset://asset-20260606171118-qd975",
    "upstream_status": "Processing",
    "asset_type": "Image",
    "description": "",
    "upload_source": "remote_url",
    "source_url": "https://storage.googleapis.com/infron_gcs/image%2Fplayground-inputs%2F15%2F20260606%2F9f0bc756-c140-4991-9dc3-0466f867f499.jpg",
    "gcs_url": "https://storage.googleapis.com/infron_gcs/image%2Fmodel-assets%2Fseedance%2F13%2F20260606%2F7e6f112e-a74f-4201-82c3-0f9d3d35073d.jpg",
    "file_name": "9f0bc756-c140-4991-9dc3-0466f867f499.jpg",
    "content_type": "image/jpeg",
    "file_ext": ".jpg",
    "file_size_bytes": 84981,
    "sha256_hash": "2f02fe67afad4099ac942962c3a0857ac9da58d332c90f459513cf6e1c13de05",
    "status": "processing",
    "last_polled_at": "2026-06-06T09:11:17Z",
    "created_at": "2026-06-06T09:11:17Z",
    "updated_at": "2026-06-06T09:11:18Z"
  },
  "message": "success"
}
```

{% endtab %}

{% tab title="status=Failed" %}

```json
{
  "code": 200,
  "data": {
    "id": 4,
    "upstream_asset_uri": "asset://asset-20260606171118-qd975",
    "upstream_status": "Failed",
    "asset_type": "Image",
    "description": "",
    "upload_source": "remote_url",
    "source_url": "https://storage.googleapis.com/infron_gcs/image%2Fplayground-inputs%2F15%2F20260606%2F9f0bc756-c140-4991-9dc3-0466f867f499.jpg",
    "gcs_url": "https://storage.googleapis.com/infron_gcs/image%2Fmodel-assets%2Fseedance%2F13%2F20260606%2F7e6f112e-a74f-4201-82c3-0f9d3d35073d.jpg",
    "file_name": "9f0bc756-c140-4991-9dc3-0466f867f499.jpg",
    "content_type": "image/jpeg",
    "file_ext": ".jpg",
    "file_size_bytes": 84981,
    "sha256_hash": "2f02fe67afad4099ac942962c3a0857ac9da58d332c90f459513cf6e1c13de05",
    "status": "failed",
    "failure_code": "upstream_failed",
    "last_polled_at": "2026-06-06T09:13:01Z",
    "created_at": "2026-06-06T09:11:17Z",
    "updated_at": "2026-06-06T09:13:01Z"
  },
  "message": "success"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Real-life portrait footage needs to be authorized, uploaded, and undergo a consistency check before it can be made usable.
{% endhint %}

### 4. Delete resources

<table><thead><tr><th width="184.09326171875">Field</th><th>Required</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><strong>id</strong></td><td><code>True</code></td><td>number</td><td>-</td><td>Resource id</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X DELETE 'https://media.onerouter.pro/v1/delete/resources/{id}' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

{% endtab %}
{% endtabs %}

Response

```json
{
  "code": 200,
  "data": {
    "deleted": true
  },
  "message": "success"
}
```

### 5. Referencing assets in model calls

The `upstream_asset_uri` returned from the upload or query operation can be used directly for video generation:

```bash
curl -X POST 'https://media.onerouter.pro/v1/videos/generations' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "{MODEL}",
    "prompt": "Generate a 4-second video using @Image1.",
    "image_urls": [
      "{upstream_asset_uri}"
    ]
  }'
```

### Retention

Uploaded files are stored for **7 days** and then automatically deleted.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://infronai.gitbook.io/docs/media-apis/advanced-features/upload-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
