# List Model Files

`GET /v1/models/{model_id}/files`

List a trained model's files: path, size and checksum of each.

The files are those its export recorded, at that exact revision. Fetch
each with ``GET /v1/models/{model_id}/files/{path}:download``, or the whole
model with ``qualia model download``.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `model_id` (path, string (uuid), required)
- `account_id` (query, string | null (uuid)): Scope to this account (the dashboard's active account). Membership is verified upstream; a non-member gets 403.
- `project_id` (query, string | null (uuid)): The workspace the model lives in; a project-restricted key must name it.

## Responses

- `200` The model's files at its export's pinned revision: `application/json` `ModelFilesResponse`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `404` No such model you can read: `application/json` `ErrorResponse`
- `409` The model has no pinned export to download: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
ModelFilesResponse:
  properties:
    model_id:
      type: string
      format: uuid
      description: The model (its artifact_id)
    revision:
      type: string
      description: The export's pinned revision
    files:
      items:
        $ref: "#/components/schemas/ModelFile"
      type: array
  type: object
  required:
    - model_id
    - revision
    - files
  title: ModelFilesResponse
  description: A trained model's files, at the revision its export recorded.
ModelFile:
  properties:
    path:
      type: string
      description: Path within the model, '/'-separated
    size:
      type: integer
      description: Size in bytes
    sha256:
      description: SHA-256 of the content; null for small files stored without one, which blob_id checks instead
      type:
        - string
        - "null"
    blob_id:
      description: Git blob id (SHA-1 of 'blob <size>\0' + content), set when sha256 is null
      type:
        - string
        - "null"
  type: object
  required:
    - path
    - size
  title: ModelFile
  description: One file of a trained model's export.
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
