Skip to main content
POST
/
api
/
modelscope
/
models
/
files
/modelscope/models/files
curl --request POST \
  --url https://api.anysite.io/api/modelscope/models/files \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "model": "<string>",
  "count": 2,
  "timeout": 300,
  "revision": "master",
  "root": ""
}
'
[
  {
    "name": "<string>",
    "@type": "ModelScopeRepoFile",
    "path": "<string>",
    "file_type": "<string>",
    "size": 123,
    "is_lfs": false,
    "sha256": "<string>",
    "mode": "<string>",
    "commit_message": "<string>",
    "committer": "<string>",
    "committed_at": 123,
    "revision": "<string>"
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
model
string
required

Model repository id ('owner/name') or full model URL

Minimum string length: 1
Example:

"Qwen/Qwen2.5-7B-Instruct"

count
integer
required

Max result count

Required range: x >= 1
timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
revision
string
default:master

Branch or tag to read files from

root
string
default:""

Folder path inside the repository to list

Response

Successful Response

name
string
required
@type
string
default:ModelScopeRepoFile
path
string | null
file_type
string | null
size
integer | null
is_lfs
boolean
default:false
sha256
string | null
mode
string | null
commit_message
string | null
committer
string | null
committed_at
integer | null
revision
string | null