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

# Upload reference asset

> Upload a reference image or video and optionally submit it for review on the BytePlus Seedance channel.

Use a production DGrid **Model API Key**. You can skip uploading if you already have a suitable HTTPS link that the server can access.

## Upload a file

Send one image or video in the multipart `file` field. The server detects the file type from its contents. Let cURL or your HTTP client set the multipart boundary automatically.

```bash theme={null}
curl -sS --fail-with-body --max-time 120 \
  "$DGRID_BASE_URL/video-assets" \
  --header "Authorization: Bearer $DGRID_API_KEY" \
  --form 'file=@./reference.jpg'
```

| File type | Accepted formats | Size limit |
| - | - | - |
| Image | JPEG, PNG, WebP, GIF, BMP, TIFF | Less than 30,000,000 bytes. |
| Video | MP4, MOV | Up to 200,000,000 bytes. |

The public gateway may enforce a smaller request body limit. The file still needs to meet model-specific requirements such as dimensions, duration, frame rate, and input combinations.

## Upload and submit for review

Set the optional query parameter `submit_for_review` to a single `true` to submit the file for review. Omit it or send `false` to upload only. A submitted video's duration must be readable at upload time.

```bash theme={null}
curl -sS --fail-with-body --max-time 120 \
  "$DGRID_BASE_URL/video-assets?submit_for_review=true" \
  --header "Authorization: Bearer $DGRID_API_KEY" \
  --form 'file=@./reference.mp4'
```

HTTP `201` confirms upload. A submission for review also returns an `asset_id`. Query that ID for the review result.

```json theme={null}
{
  "url": "https://example.invalid/reference.mp4?X-Amz-Expires=86400&X-Amz-Signature=example",
  "expires_at": "2026-12-01T08:00:00Z",
  "content_type": "video/mp4",
  "size_bytes": 2486109,
  "width": 1280,
  "height": 720,
  "duration_seconds": "5.000000000",
  "fps": "24.000000",
  "asset_id": "asset-example"
}
```

| Field | Type and description |
| - | - |
| `url` | String. Signed HTTPS link. Keep the full query string and treat it as private. |
| `expires_at` | String. RFC 3339 expiry timestamp. The signed link is valid for 24 hours from issuance. |
| `content_type` | String. MIME type detected by the server. |
| `size_bytes` | Integer. File size in bytes. |
| `width`, `height` | Optional integers. Detected dimensions in pixels. |
| `duration_seconds` | Optional decimal string. Video duration in seconds. |
| `fps` | Optional decimal string. Average video frame rate. |
| `asset_id` | Optional string. Official ID returned when you submit an asset for review. |

To use a signed upload URL in a new request after it expires, upload the file again to obtain a fresh URL. You can also use the ID of an `Active` asset as described in [Create video](https://docs.dgrid.ai/api-reference/videos/create-video.md).

## Check review status

Send `GET /v1/video-assets/{asset_id}` with credentials for the same DGrid user. Use the `asset_id` from the upload response. The request has no body.

```bash theme={null}
ASSET_ID='replace-with-returned-asset-id'
curl -sS --fail-with-body --max-time 30 \
  "$DGRID_BASE_URL/video-assets/$ASSET_ID" \
  --header "Authorization: Bearer $DGRID_API_KEY"
```

```json theme={null}
{
  "asset_id": "asset-example",
  "status": "Active"
}
```

| Status | What to do |
| - | - |
| `Processing` | Review or preprocessing is underway. Continue polling with a local timeout. |
| `Active` | You can reference the asset in a supported generation request. |
| `Failed` | Stop polling and check for an optional `error_code` in the response. |

Status values are case-sensitive. Keep the asset ID and investigate any unrecognized status. You can resume polling with that ID if the local wait times out.

## Upload and review errors

For `409 video_asset_submission_unconfirmed`, the same asset is being submitted or upstream acceptance is uncertain. If you have an `asset_id`, query it. Otherwise, wait and retry submission with the same file. Contact DGrid support if the error persists. The video creation idempotency key applies to video creation requests only.

| HTTP status | Error or condition | What to do |
| - | - | - |
| `400` | `invalid_video_asset_upload` | Send exactly one multipart `file` field. |
| `400` | `invalid_submit_for_review` | Send a single `true` or `false` as a URL query parameter. |
| `401` / `403` | Authentication or permission error | Check the production key, user, and permissions. |
| `404` | `video_asset_not_found` | Check the asset ID and user. |
| `405` | `unsupported_video_operation` | Use `POST` to upload. |
| `413` | `video_asset_too_large`, `body_too_large`, or gateway limit | Use a smaller file. |
| `415` | `unsupported_video_asset_type` | Use a supported image or video format. |
| `422` | `input_duration_unavailable` | Provide a video with a readable duration. |
| `429` | Rate limit | Honor `Retry-After` when present. |
| `502` | `video_asset_upload_failed` or `invalid_video_service_response` | Wait before retrying. Keep the original file and any returned ID. |
| `502` | `video_asset_submission_rejected` | Check the response for details about the rejected submission. Contact support if needed. |
| `503` | `video_asset_upload_unavailable`, `video_service_unavailable`, `video_disabled`, or `video_asset_review_unavailable` | Wait for the service to recover. If you have an asset ID, query that asset again. |
| `504` | `video_asset_upload_failed` | The storage upload timed out. Wait before retrying. |


## OpenAPI

````yaml api-reference/openapi.json POST /v1/video-assets
openapi: 3.1.0
info:
  title: DGrid AI Gateway API
  description: >-
    A single, unified API to access 200+ leading AI models. OpenAI-, Claude-,
    and Gemini-compatible endpoints for chat, completions, embeddings, images,
    video, audio, and moderations.
  version: 1.0.0
  contact:
    name: DGrid AI
    url: https://dgrid.ai
servers:
  - url: https://api.dgrid.ai
    description: DGrid AI Gateway
security:
  - bearerAuth: []
paths:
  /v1/video-assets:
    post:
      tags:
        - Videos
      summary: Upload reference asset
      description: >-
        Upload a single reference image or video. You can also submit the file
        for review on the BytePlus Seedance channel.
      operationId: uploadVideoReferenceAsset
      parameters:
        - name: submit_for_review
          in: query
          description: Set to true to submit the file for review as part of the upload.
          required: false
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  description: Reference image or video file.
                  format: binary
      responses:
        '201':
          description: Reference asset uploaded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: Signed HTTPS URL valid for 24 hours after issuance.
                    format: uri
                  expires_at:
                    type: string
                    description: RFC 3339 timestamp when the signed URL expires.
                    format: date-time
                  content_type:
                    type: string
                    description: MIME type detected from the file.
                  size_bytes:
                    type: integer
                    description: File size in bytes.
                  width:
                    type: integer
                    description: Detected width in pixels, when available.
                  height:
                    type: integer
                    description: Detected height in pixels, when available.
                  duration_seconds:
                    type: string
                    description: >-
                      Video duration in seconds as a decimal string, when
                      available.
                  fps:
                    type: string
                    description: >-
                      Average video frame rate as a decimal string, when
                      available.
                  asset_id:
                    type: string
                    description: >-
                      Official asset ID returned when the file is submitted for
                      review.
              example:
                url: >-
                  https://example.invalid/reference.mp4?X-Amz-Expires=86400&X-Amz-Signature=example
                expires_at: '2026-12-01T08:00:00Z'
                content_type: video/mp4
                size_bytes: 2486109
                width: 1280
                height: 720
                duration_seconds: '5.000000000'
                fps: '24.000000'
                asset_id: asset-example
        '400':
          description: Invalid upload or review query parameter.
        '401':
          description: Unauthorized.
        '403':
          description: Permission denied.
        '405':
          description: Unsupported operation.
        '409':
          description: Asset review submission unconfirmed.
        '413':
          description: File or request body too large.
        '415':
          description: Unsupported asset format.
        '422':
          description: Video duration unavailable.
        '429':
          description: Rate limit exceeded.
        '502':
          description: >-
            Upload failed, service response invalid, or review submission
            rejected.
        '503':
          description: Upload or review service unavailable.
        '504':
          description: Storage upload timed out.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your DGrid API key. All endpoints use `Authorization: Bearer
        <DGRID_API_KEY>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.