API Platform

List Files

Paginated query of files uploaded by the current tenant. This endpoint aligns with the Files list operation and returns a list object.

GET
/v1/files

Returns a paginated list of files uploaded by the current tenant, with filtering by count, offset, and purpose.

Authentication

Add Authorization: Bearer <API_KEY> to the request header to authenticate. You can generate a key on the "API Keys" page of the console.

Example
curl https://api.mosi.cn/v1/files \
  -H "Authorization: Bearer $MOSS_API_KEY"

Request parameters

QueryTypeRequiredDescription
limitintegerNo

Number of records to return. Valid range: 1–200.

offsetintegerNo

Offset. Valid range: 0–100000.

purposestringNo

Filter by purpose.

Request example

Example
curl "https://api.mosi.cn/v1/files?purpose=audio&limit=20" \
  -H "Authorization: Bearer $MOSS_API_KEY"

Response fields

FieldTypeAlways returnedDescription
objectstringYes

Fixed as list.

data[].idstringYes

File id, i.e. the file_id used by subsequent endpoints.

data[].objectstringYes

Fixed as file.

data[].bytesintegerYes

File size in bytes.

data[].created_atintegerYes

Creation time, a Unix timestamp in seconds.

data[].filenamestringYes

Original filename.

data[].purposestringYes

File purpose marker; may be an empty string.

data[].statusstringYes

File status, subject to the actual server response.

Response example

Response example
{
  "object": "list",
  "data": [
    {
      "id": "<file_id>",
      "object": "file",
      "bytes": 1048576,
      "created_at": 1710000000,
      "filename": "speech.wav",
      "purpose": "audio",
      "status": "active"
    }
  ]
}

Next steps