Get File
Query the metadata of a single file; returns a file object.
GET
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.
curl https://api.mosi.cn/v1/files \
-H "Authorization: Bearer $MOSS_API_KEY"
Request parameters
| Path parameter | Type | Required | Description |
|---|---|---|---|
| file_id | string | Yes | The |
Request example
curl "https://api.mosi.cn/v1/files/<file_id>" \
-H "Authorization: Bearer $MOSS_API_KEY"
Response fields
| Field | Type | Always returned | Description |
|---|---|---|---|
| id | string | Yes | File id, i.e. the |
| object | string | Yes | Fixed as |
| bytes | integer | Yes | File size in bytes. |
| created_at | integer | Yes | Creation time, a Unix timestamp in seconds. |
| filename | string | Yes | Original filename. |
| purpose | string | Yes | File purpose marker; may be an empty string. |
| status | string | Yes | File status, subject to the actual server response. |
Response example
{
"id": "<file_id>",
"object": "file",
"bytes": 1048576,
"created_at": 1710000000,
"filename": "speech.wav",
"purpose": "audio",
"status": "active"
}