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

# Get Upload URL

> Get a signed URL for uploading a file.

## Body Parameters

<ParamField body="filename" type="string" required>
  Original filename (e.g. `my-image.jpg`).
</ParamField>

<ParamField body="contentType" type="string" required>
  MIME type of the file (e.g. `image/jpeg`, `video/mp4`, `audio/mpeg`).
</ParamField>

<ParamField body="sizeBytes" type="number" required>
  File size in bytes. Max 100 MB.
</ParamField>

## Response Fields

<ResponseField name="success" type="boolean">
  Whether the request was successful.
</ResponseField>

<ResponseField name="data" type="object">
  Upload URL details.

  <Expandable title="data properties">
    <ResponseField name="data.upload_url" type="string">
      Pre-signed URL for uploading the file via HTTP PUT. Valid for 15 minutes.
    </ResponseField>

    <ResponseField name="data.file_id" type="string">
      Unique file identifier. Use this to call [Complete Upload](/api-reference/files/complete-upload) after uploading.
    </ResponseField>

    <ResponseField name="data.expires_at" type="string">
      ISO 8601 timestamp when the upload URL expires.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "upload_url": "https://storage.modelhunter.ai/uploads/file_abc123?X-Amz-Signature=...",
      "file_id": "file_abc123",
      "expires_at": "2025-01-15T11:00:00Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid contentType: must be a supported MIME type"
    }
  }
  ```

  ```json 422 theme={null}
  {
    "success": false,
    "error": {
      "code": "FILE_TOO_LARGE",
      "message": "File size exceeds the 100 MB limit"
    }
  }
  ```
</ResponseExample>
