API Platform

Get File

Query the metadata of a single file; returns a file object.

GET
/v1/files/{file_id}

Returns the metadata of a single file (a file object) by file_id.

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

Path parameterTypeRequiredDescription
file_idstringYes

The id returned by POST /v1/files.

Request example

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

Response fields

FieldTypeAlways returnedDescription
idstringYes

File id, i.e. the file_id.

objectstringYes

Fixed as file.

bytesintegerYes

File size in bytes.

created_atintegerYes

Creation time, a Unix timestamp in seconds.

filenamestringYes

Original filename.

purposestringYes

File purpose marker; may be an empty string.

statusstringYes

File status, subject to the actual server response.

Response example

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

Next steps