> ## 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.

# 참고 자료 업로드

> 참고 이미지나 동영상을 업로드하고, 필요에 따라 BytePlus Seedance 채널에서 검토를 요청합니다.

운영 환경의 DGrid **Model API Key**를 사용하세요. 서버에서 액세스할 수 있는 적절한 HTTPS 링크가 이미 있으면 업로드를 건너뛸 수 있습니다.

## 파일 업로드

multipart `file` 필드에 이미지나 동영상 파일 하나를 담아 보내세요. 서버가 파일 내용으로 유형을 감지합니다. multipart 경계 문자열은 cURL이나 HTTP 클라이언트가 자동으로 설정하도록 하세요.

```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'
```

| 파일 유형 | 지원 형식 | 파일 크기 제한 |
| - | - | - |
| 이미지 | JPEG, PNG, WebP, GIF, BMP, TIFF | 30,000,000바이트 미만입니다. |
| 동영상 | MP4, MOV | 최대 200,000,000바이트입니다. |

공개 게이트웨이에는 더 작은 요청 본문 제한이 적용될 수 있습니다. 크기, 재생 시간, 프레임 레이트, 입력 조합 등 모델의 요구 사항도 충족해야 합니다.

## 업로드 및 검토 요청

선택 사항인 쿼리 매개변수 `submit_for_review`에 `true`를 하나만 지정하면 검토가 요청됩니다. 생략하거나 `false`를 보내면 업로드만 수행합니다. 검토할 동영상은 업로드 시점에 재생 시간을 읽을 수 있어야 합니다.

```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`은 업로드가 완료되었음을 의미합니다. 검토를 요청하면 `asset_id`도 반환됩니다. 이 ID로 검토 결과를 조회하세요.

```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"
}
```

| 필드 | 유형 및 설명 |
| - | - |
| `url` | 문자열입니다. 서명된 HTTPS 링크입니다. 전체 쿼리 문자열을 유지하고 외부에 공개하지 마세요. |
| `expires_at` | RFC 3339 형식의 만료 시각 문자열입니다. 서명된 링크는 발급 후 24시간 동안 유효합니다. |
| `content_type` | 서버가 감지한 MIME 유형 문자열입니다. |
| `size_bytes` | 바이트 단위 파일 크기를 나타내는 정수입니다. |
| `width`, `height` | 감지된 픽셀 단위의 크기를 나타내는 선택적 정수입니다. |
| `duration_seconds` | 초 단위의 동영상 재생 시간을 나타내는 선택적 십진수 문자열입니다. |
| `fps` | 동영상의 평균 프레임 레이트를 나타내는 선택적 십진수 문자열입니다. |
| `asset_id` | 검토를 요청할 때 반환되는 공식 ID 문자열입니다. |

서명된 URL이 만료된 후 새 요청에 사용하려면 파일을 다시 업로드하여 새 URL을 받으세요. [동영상 생성 API](https://docs.dgrid.ai/ko/api-reference/videos/create-video.md)에 설명된 대로 `Active` 상태의 자료 ID도 사용할 수 있습니다.

## 검토 상태 조회

동일한 DGrid 사용자의 인증 정보로 `GET /v1/video-assets/{asset_id}`를 호출하세요. 업로드 응답의 `asset_id`를 사용하세요. 요청 본문은 필요하지 않습니다.

```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"
}
```

| 상태 | 처리 방법 |
| - | - |
| `Processing` | 검토 또는 전처리 중입니다. 로컬 대기 시간 제한을 설정하고 계속 조회하세요. |
| `Active` | 지원되는 생성 요청에서 자료를 참조할 수 있습니다. |
| `Failed` | 폴링을 중단하고 응답에 `error_code`가 있는지 확인하세요. |

상태 값은 대소문자를 구분합니다. 알 수 없는 상태는 자료 ID를 보관하고 원인을 확인하세요. 로컬 대기 시간이 초과되면 같은 ID로 폴링을 재개할 수 있습니다.

## 업로드 및 검토 오류

`409 video_asset_submission_unconfirmed`는 동일한 자료의 검토 요청이 진행 중이거나 공급자의 접수 여부가 불확실함을 의미합니다. `asset_id`가 있으면 해당 자료를 조회하세요. ID가 없으면 잠시 기다린 후 같은 파일로 검토를 다시 요청하세요. 오류가 계속되면 DGrid 지원팀에 문의하세요. 동영상 생성 멱등성 키는 생성 요청에만 적용됩니다.

| HTTP 상태 | 오류 또는 상황 | 처리 방법 |
| - | - | - |
| `400` | `invalid_video_asset_upload` | multipart `file` 필드를 하나만 보내세요. |
| `400` | `invalid_submit_for_review` | URL 쿼리 매개변수에 `true` 또는 `false`를 한 번만 지정하세요. |
| `401` / `403` | 인증 또는 권한 오류 | 운영 환경의 키, 사용자, 권한을 확인하세요. |
| `404` | `video_asset_not_found` | 자료 ID와 사용자를 확인하세요. |
| `405` | `unsupported_video_operation` | 업로드에 `POST`를 사용하세요. |
| `413` | `video_asset_too_large`, `body_too_large` 또는 게이트웨이 제한 | 더 작은 파일을 사용하세요. |
| `415` | `unsupported_video_asset_type` | 지원되는 이미지 또는 동영상 형식을 사용하세요. |
| `422` | `input_duration_unavailable` | 재생 시간을 읽을 수 있는 동영상을 사용하세요. |
| `429` | 속도 제한 | `Retry-After`가 있으면 따르세요. |
| `502` | `video_asset_upload_failed` 또는 `invalid_video_service_response` | 잠시 기다렸다가 다시 시도하세요. 원본 파일과 반환된 ID를 보관하세요. |
| `502` | `video_asset_submission_rejected` | 응답에서 거부 사유를 확인하고 필요하면 지원팀에 문의하세요. |
| `503` | `video_asset_upload_unavailable`, `video_service_unavailable`, `video_disabled` 또는 `video_asset_review_unavailable` | 서비스가 복구될 때까지 기다리세요. ID가 있으면 동일한 자료를 다시 조회하세요. |
| `504` | `video_asset_upload_failed` | 스토리지 업로드 시간이 초과되었습니다. 잠시 기다렸다가 다시 시도하세요. |


## 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.