openapi: 3.1.0 info: title: Hub API Endpoints agentic-provisioning datasets API version: 0.0.1 description: 'We have open endpoints that you can use to retrieve information from the Hub as well as perform certain actions such as creating model, dataset or Space repos. We offer a wrapper Python client, [`huggingface_hub`](https://github.com/huggingface/huggingface_hub), and a JS client, [`huggingface.js`](https://github.com/huggingface/huggingface.js), that allow easy access to these endpoints. We also provide [webhooks](https://huggingface.co/docs/hub/webhooks) to receive real-time incremental info about repos. Enjoy! The base URL for those endpoints below is `https://huggingface.co`. For example, to construct the `/api/models` call below, one can call the URL [https://huggingface.co/api/models](https://huggingface.co/api/models). If you''re an Agent, you might prefer the [markdown version OpenAPI spec](https://huggingface.co/.well-known/openapi.md). ' servers: - url: https://huggingface.co description: Hub security: - bearerAuth: [] tags: - name: datasets x-displayName: Datasets description: Get information from all datasets on the Hub. paths: /api/datasets/{namespace}/{repo}/treesize/{rev}/{path}: get: description: Get the total size of a repository at a given revision, optionally under a specific subpath. Returns the total size in bytes of all files under the specified path (recursively). If a file is stored via Xet/LFS, the LFS file size is used. summary: Get folder size tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: path: description: The normalized path of the subtree, starting with a slash type: string size: description: Total size in bytes of all files under the subtree type: integer minimum: -9007199254740991 maximum: 9007199254740991 required: - path - size additionalProperties: false description: Total size of a repository at a given revision, under the given path parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: path in: path required: true schema: type: string description: Wildcard path parameter /api/datasets/{namespace}/{repo}/lfs-files: get: description: List Xet/LFS files for a repo summary: List Large files tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: pusher: type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: user isPro: type: boolean isUserFollowing: type: boolean primaryOrg: type: object properties: avatarUrl: type: string fullname: type: string name: type: string type: const: org isHf: type: boolean isFollowing: type: boolean plan: enum: - team - enterprise - plus - academia details: type: string hasPrivateMembersList: type: boolean userRole: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string numUsers: type: number required: - avatarUrl - fullname - name - type - isHf additionalProperties: false required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type - isPro additionalProperties: false ref: type: string fileOid: type: string oid: type: string size: type: number pushedAt: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ filename: description: Potential filename of the LFS file type: string xetHash: type: string required: - fileOid - oid - size - pushedAt additionalProperties: false description: List of Xet/LFS files for the repo headers: Link: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: Link header for pagination, can contain a `rel="next"` link parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: cursor in: query schema: type: string required: false - name: limit in: query schema: default: 1000 type: integer minimum: 1 maximum: 1000 required: false - name: xet in: query schema: {} required: false /api/datasets/{namespace}/{repo}/lfs-files/batch: post: description: Delete Xet/LFS files in batch summary: Delete Large files tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: deletions: type: object properties: sha: minItems: 1 maxItems: 1000 type: array items: type: string rewriteHistory: default: true type: boolean required: - sha required: - deletions parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/lfs-files/{sha}: delete: description: Delete a Xet/LFS file summary: Delete Large file tags: - datasets parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: sha in: path required: true schema: type: string - name: rewriteHistory in: query schema: default: true required: false /api/datasets/{namespace}/{repo}/lfs-files/duplicate: post: description: Duplicate xet-stored files from this repo (source) into another repo (target) by xet hash, without re-uploading file bytes. The caller must then commit the files with their sha256/size as usual. summary: Duplicate xet files tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: target: type: object properties: type: enum: - dataset - model - space - kernel name: type: string minLength: 1 required: - type - name files: minItems: 1 maxItems: 1000 type: array items: type: object properties: xetHash: type: string minLength: 64 maxLength: 64 pattern: ^[0-9a-fA-F]{64}$ sha256: type: string minLength: 64 maxLength: 64 pattern: ^[0-9a-fA-F]{64}$ filename: type: string maxLength: 1000 required: - xetHash - sha256 required: - target - files responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: success: description: True if all requested files were duplicated (or already present) type: boolean processed: description: Total number of unique files processed type: integer minimum: -9007199254740991 maximum: 9007199254740991 succeeded: description: Number of files duplicated or already present in the target type: integer minimum: -9007199254740991 maximum: 9007199254740991 failed: description: Per-file failures type: array items: type: object properties: xetHash: description: Xet content hash of the file that failed type: string sha256: description: sha256 of the file that failed type: string error: description: Error message type: string required: - xetHash - sha256 - error additionalProperties: false required: - success - processed - succeeded - failed additionalProperties: false description: Duplicate xet files response '207': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: success: description: True if all requested files were duplicated (or already present) type: boolean processed: description: Total number of unique files processed type: integer minimum: -9007199254740991 maximum: 9007199254740991 succeeded: description: Number of files duplicated or already present in the target type: integer minimum: -9007199254740991 maximum: 9007199254740991 failed: description: Per-file failures type: array items: type: object properties: xetHash: description: Xet content hash of the file that failed type: string sha256: description: sha256 of the file that failed type: string error: description: Error message type: string required: - xetHash - sha256 - error additionalProperties: false required: - success - processed - succeeded - failed additionalProperties: false description: Duplicate xet files response parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/commits/{rev}: get: summary: List commits tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: id: type: string title: type: string message: type: string authors: type: array items: type: object properties: user: type: string avatar: type: string required: - user additionalProperties: false date: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ formatted: description: Available if expand includes formatted type: object properties: title: type: string message: type: string required: - title additionalProperties: false required: - id - title - message - authors - date additionalProperties: false description: Commits list headers: X-Total-Count: schema: $schema: https://json-schema.org/draft/2020-12/schema type: integer minimum: -9007199254740991 maximum: 9007199254740991 Link: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: Link to the next page parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: p in: query schema: default: 0 type: integer minimum: -9007199254740991 maximum: 9007199254740991 required: false - name: expand in: query schema: type: array items: enum: - formatted required: false - name: limit in: query schema: default: 50 type: integer minimum: 1 maximum: 1000 required: false /api/datasets/{namespace}/{repo}/refs: get: summary: List references tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: tags: type: array items: type: object properties: name: type: string ref: type: string targetCommit: type: string required: - name - ref - targetCommit additionalProperties: false branches: type: array items: type: object properties: name: type: string ref: type: string targetCommit: type: string required: - name - ref - targetCommit additionalProperties: false converts: type: array items: type: object properties: name: type: string ref: type: string targetCommit: type: string required: - name - ref - targetCommit additionalProperties: false pullRequests: type: array items: type: object properties: name: type: string ref: type: string targetCommit: type: string required: - name - ref - targetCommit additionalProperties: false required: - tags - branches - converts additionalProperties: false description: List of references in the repository parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: include_prs in: query schema: default: false required: false /api/datasets/{namespace}/{repo}/compare/{compare}: get: summary: Get a compare rev tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: The diff between the two revisions parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: compare in: path required: true schema: type: string - name: raw in: query schema: default: false required: false /api/datasets/{namespace}/{repo}/paths-info/{rev}: post: summary: List paths info tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: paths: anyOf: - maxItems: 2000 type: array items: type: string - type: string expand: description: Expand the response with the last commit and security file status anyOf: - default: false - default: false type: boolean required: - paths - expand responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: type: enum: - file - directory - unknown oid: type: string size: type: number lfs: type: object properties: pointerSize: type: number required: - pointerSize additionalProperties: false xetHash: type: string path: type: string lastCommit: type: object properties: id: type: string title: type: string date: type: string required: - id - title - date additionalProperties: false securityFileStatus: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe jFrogScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false protectAiScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false avScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false pickleImportScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false virusTotalScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false required: - status - avScan - pickleImportScan additionalProperties: false required: - type - oid - size - path additionalProperties: false description: List of paths in the repository parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/preupload/{rev}: post: description: Check if a file should be uploaded through the Large File mechanism or directly. summary: Check upload method tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: files: maxItems: 1000 type: array items: type: object properties: path: type: string size: type: number sample: type: string required: - path - size - sample gitAttributes: description: 'Provide this parameter if you plan to modify `.gitattributes` yourself at the same time as uploading LFS files. Note that this is not needed if you solely rely on automatic LFS detection from HF: the commit endpoint will automatically edit the `.gitattributes` file to track the files passed to its `lfsFiles` param.' type: string gitIgnore: description: Content of the .gitignore file for the revision. Optional, otherwise takes the existing content of `.gitignore` for the revision. type: string required: - files responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: files: type: array items: type: object properties: path: type: string uploadMode: enum: - lfs - regular shouldIgnore: type: boolean oid: description: The oid of the blob if it already exists in the repository. If the blob is a LFS file, it'll be the lfs oid. type: string required: - path - uploadMode - shouldIgnore additionalProperties: false commitOid: type: string required: - files - commitOid additionalProperties: false description: Files to be uploaded. '422': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: The request is invalid parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/xet-write-token/{rev}: get: description: Get a write short-lived access token for XET upload summary: Xet write token tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: casUrl: type: string exp: type: number accessToken: type: string required: - casUrl - exp - accessToken additionalProperties: false description: The response from the getXetWriteAccessToken endpoint. headers: X-Xet-Cas-Url: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string X-Xet-Token-Expiration: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string X-Xet-Access-Token: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/xet-read-token/{rev}: get: description: Get a read short-lived access token for XET summary: Xet read token tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: casUrl: type: string exp: type: number accessToken: type: string required: - casUrl - exp - accessToken additionalProperties: false description: The response from the getXetReadAccessToken endpoint. headers: X-Xet-Cas-Url: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string X-Xet-Token-Expiration: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string X-Xet-Access-Token: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/commit/{rev}: post: description: "For legacy reason, we support both `application/json` and `application/x-ndjson` but we recommend using `application/x-ndjson` to create a commit.\n\nJSON-lines payload:\n```json\n{\n \"key\": \"header\",\n \"value\": {\n \"summary\": \"string (REQUIRED)\",\n \"description\": \"string (OPTIONAL - defaults to empty string)\",\n \"parentCommit\": \"string (OPTIONAL - 40-character hex SHA)\"\n }\n}\n{\n \"key\": \"file\",\n \"value\": {\n \"path\": \"string (REQUIRED)\",\n \"content\": \"string (OPTIONAL - required if oldPath not set)\",\n \"encoding\": \"utf-8 | base64 (OPTIONAL - defaults to utf-8)\",\n \"oldPath\": \"string (OPTIONAL - for move/rename operations)\"\n }\n}\n{\n \"key\": \"deletedEntry\",\n \"value\": {\n \"path\": \"string (REQUIRED)\"\n }\n}\n{\n \"key\": \"lfsFile\",\n \"value\": {\n \"path\": \"string (REQUIRED - max 1000 chars)\",\n \"oid\": \"string (OPTIONAL - required if oldPath not set, 64 hex chars)\",\n \"algo\": \"sha256 (OPTIONAL - only sha256 supported)\",\n \"size\": \"number (OPTIONAL - required if oldPath is set)\",\n \"oldPath\": \"string (OPTIONAL - for move/rename operations)\"\n }\n}\n```\n\nJSON payload:\n```json\n{\n \"summary\": \"string (REQUIRED)\",\n \"description\": \"string (OPTIONAL - defaults to empty string)\",\n \"parentCommit\": \"string (OPTIONAL - 40-character hex SHA)\"\n \"files\": [\n {\n \"path\": \"string (REQUIRED)\",\n \"content\": \"string (OPTIONAL - required if oldPath not set)\",\n \"encoding\": \"utf-8 | base64 (OPTIONAL - defaults to utf-8)\",\n \"oldPath\": \"string (OPTIONAL - for move/rename operations)\"\n }\n ],\n \"deletedEntries\": [\n {\n \"path\": \"string (REQUIRED)\"\n }\n ],\n \"lfsFiles\": [\n {\n \"path\": \"string (REQUIRED - max 1000 chars)\",\n \"oid\": \"string (OPTIONAL - required if oldPath not set, 64 hex chars)\",\n \"algo\": \"sha256 (OPTIONAL - only sha256 supported)\",\n \"size\": \"number (OPTIONAL - required if oldPath is set)\",\n \"oldPath\": \"string (OPTIONAL - for move/rename operations)\"\n }\n ]\n}\n```\n" summary: Commit tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: success: description: Whether the commit was successful type: boolean pullRequestUrl: description: The URL of the pull request type: string commitOid: description: The OID of the commit type: string commitUrl: description: The URL of the commit type: string hookOutput: description: The output of the git hook type: string required: - success - commitOid - commitUrl - hookOutput additionalProperties: false description: The response of the commit parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: create_pr in: query schema: description: Whether to create a pull request from the commit required: false - name: hot_reload in: query schema: description: For Spaces, whether to try to hot reload the commit (only for single python files updates) required: false - name: Content-Type in: header schema: $schema: https://json-schema.org/draft/2020-12/schema description: '`application/x-ndjson` if you to commit by json lines' default: application/x-ndjson enum: - application/json - application/x-ndjson /api/datasets/{namespace}/{repo}/tag/{rev}: post: summary: Create tag tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: tag: type: string message: type: string required: - tag parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string delete: summary: Delete a tag tags: - datasets parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/branch/{rev}: post: summary: Create branch tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: startingPoint: description: The commit to start from type: string emptyBranch: description: Create an empty branch default: false type: boolean overwrite: description: Overwrite the branch if it already exists default: false type: boolean parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string delete: summary: Delete a branch tags: - datasets parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/resource-group: post: description: Add the repository to a resource group summary: Add resource group tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: resourceGroupId: description: The resource group to add the repository to, if null, the repository will be removed from the resource group anyOf: - type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ - type: 'null' required: - resourceGroupId responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: name: type: string type: enum: - dataset - model - space - bucket - kernel private: type: boolean addedBy: type: string required: - name - type - private - addedBy additionalProperties: false description: Minimal information about the repository parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string get: summary: Get resource group tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ name: type: string numUsers: type: number required: - id - name additionalProperties: false description: The resource group of the repository parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/super-squash/{rev}: post: description: Squash all commits in the current ref into a single commit with the given message. Action is irreversible. summary: Squash ref tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: message: type: string maxLength: 500 responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: commitId: description: The new commit ID after the squash type: string required: - commitId additionalProperties: false description: Response containing the new commit ID after the squash parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/settings: put: description: Update the settings of a repo summary: Update repo settings tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: private: type: boolean visibility: description: Repository visibility. `protected` is only supported for Spaces. enum: - private - public - protected discussionsDisabled: type: boolean discussionsSorting: enum: - recently-created - trending - reactions gated: anyOf: - const: false - enum: - auto - manual orgMembersGated: description: If true, members of the owning org (except admins) must also go through the gated access-request flow. type: boolean gatedNotificationsEmail: type: string format: email pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ gatedNotificationsMode: enum: - bulk - real-time responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: private: type: boolean visibility: description: Repository visibility. `protected` is only supported for Spaces. enum: - private - public - protected discussionsDisabled: type: boolean discussionsSorting: enum: - recently-created - trending - reactions gated: anyOf: - const: false - enum: - auto - manual orgMembersGated: description: If true, members of the owning org (except admins) must also go through the gated access-request flow. type: boolean gatedNotificationsEmail: type: string format: email pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ gatedNotificationsMode: enum: - bulk - real-time additionalProperties: false description: The updated repo settings. parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/tree/{rev}/{path}: get: description: List the content of a repository tree, with pagination support. summary: List folder content tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: type: enum: - file - directory - unknown oid: type: string size: description: If the file is a LFS pointer, it'll return the size of the remote file type: integer minimum: -9007199254740991 maximum: 9007199254740991 lfs: type: object properties: oid: type: string size: type: integer minimum: -9007199254740991 maximum: 9007199254740991 pointerSize: type: integer minimum: -9007199254740991 maximum: 9007199254740991 required: - oid - size - pointerSize additionalProperties: false xetHash: type: string lastCommit: type: object properties: id: type: string title: type: string date: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ required: - id - title - date additionalProperties: false securityFileStatus: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe jFrogScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false protectAiScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false avScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false pickleImportScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false virusTotalScan: type: object properties: status: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe message: type: string reportLink: type: string reportLabel: type: string pickleImports: type: array items: type: object properties: module: type: string name: type: string safety: enum: - innocuous - suspicious - dangerous required: - module - name - safety additionalProperties: false version: type: string required: - status additionalProperties: false required: - status - avScan - pickleImportScan additionalProperties: false required: - type - oid additionalProperties: false description: List of entries in the repository tree headers: Link: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: Link header for pagination, if applicable parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: path in: path required: true schema: type: string description: Wildcard path parameter - name: expand in: query schema: description: If true, returns returns associated commit data for each entry and security scanner metadata. default: false required: false - name: recursive in: query schema: description: If true, returns the tree recursively. default: false required: false - name: limit in: query schema: description: 1.000 by default, 100 by default for expand=true type: integer minimum: 1 maximum: 9007199254740991 required: false - name: cursor in: query schema: type: string required: false /api/datasets/{namespace}/{repo}/notebook/{rev}/{path}: get: description: Get a jupyter notebook URL for the requested file summary: Get notebook URL tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: object properties: error: type: string required: - error additionalProperties: false - type: object properties: notInCache: const: true required: - notInCache additionalProperties: false - type: object properties: url: type: string required: - url additionalProperties: false description: Response containing the url of the notebook parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: path in: path required: true schema: type: string description: Wildcard path parameter /api/datasets/{namespace}/{repo}/scan: get: description: Get the security status of a repo summary: Get security status tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: scansDone: type: boolean filesWithIssues: type: array items: type: object properties: path: type: string level: enum: - unscanned - safe - queued - error - caution - suspicious - unsafe required: - path - level additionalProperties: false required: - scansDone - filesWithIssues additionalProperties: false description: The security status of the repo parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/leaderboard: get: description: Returns the evaluation results ranked by score for a dataset/task summary: Get the leaderboard for a dataset tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: rank: type: number modelId: type: string author: anyOf: - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: org plan: enum: - team - enterprise - plus - academia isUserFollowing: type: boolean required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type additionalProperties: false - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: user isPro: type: boolean isUserFollowing: type: boolean primaryOrg: type: object properties: avatarUrl: type: string fullname: type: string name: type: string type: const: org isHf: type: boolean isFollowing: type: boolean plan: enum: - team - enterprise - plus - academia details: type: string hasPrivateMembersList: type: boolean userRole: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string numUsers: type: number required: - avatarUrl - fullname - name - type - isHf additionalProperties: false required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type - isPro additionalProperties: false value: type: number verified: type: boolean source: type: object properties: url: type: string name: type: string isExternal: type: boolean author: anyOf: - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: org plan: enum: - team - enterprise - plus - academia isUserFollowing: type: boolean required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type additionalProperties: false - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: user isPro: type: boolean isUserFollowing: type: boolean primaryOrg: type: object properties: avatarUrl: type: string fullname: type: string name: type: string type: const: org isHf: type: boolean isFollowing: type: boolean plan: enum: - team - enterprise - plus - academia details: type: string hasPrivateMembersList: type: boolean userRole: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string numUsers: type: number required: - avatarUrl - fullname - name - type - isHf additionalProperties: false required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type - isPro additionalProperties: false required: - url - isExternal additionalProperties: false pullRequest: type: number filename: type: string notes: type: string lower_is_better: type: boolean num_parameters: type: number required: - rank - modelId - author - value - filename additionalProperties: false description: Evaluation results parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: task_id in: query schema: type: string required: false - name: max_params in: query schema: type: string required: false /api/datasets/{namespace}/{repo}/jwt: get: description: Generate a JWT token for accessing a repository. Supports optional write access for spaces in dev mode, custom expiration, and encryption. summary: Generate JWT tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: accessToken: description: The JWT token with Bearer prefix type: string exp: description: Token expiration timestamp in seconds (JWT standard) type: integer minimum: -9007199254740991 maximum: 9007199254740991 token: description: The JWT token type: string encryptedToken: description: Encrypted JWT token and key ID (only if encrypted=true was requested) type: object properties: encrypted: description: The encrypted JWT token type: string keyId: description: Key ID used to encrypt the token type: string required: - encrypted - keyId additionalProperties: false required: - accessToken - token additionalProperties: false description: The JWT token and related information parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: write in: query schema: {} required: false - name: expiration in: query schema: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ required: false - name: encrypted in: query schema: {} required: false - name: inference_api in: query schema: {} required: false - name: include_pro_status in: query schema: {} required: false - name: billing_details in: query schema: {} required: false /api/datasets-tags-by-type: get: description: Get all possible tags used for datasets, grouped by tag type. Optionally restrict to only one tag type summary: Get dataset tags tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object propertyNames: anyOf: - enum: - benchmark - task_categories - size_categories - modality - format - library - language - license - arxiv - doi - region - other - task_ids - annotations_creators - language_creators - multilinguality - source_datasets - not: {} additionalProperties: type: array items: type: object properties: id: type: string label: type: string type: enum: - benchmark - task_categories - size_categories - modality - format - library - language - license - arxiv - doi - region - other - task_ids - annotations_creators - language_creators - multilinguality - source_datasets subType: type: string clickable: default: true type: boolean required: - id - label - type additionalProperties: false description: The tags, grouped by tag type parameters: - name: type in: query schema: enum: - benchmark - task_categories - size_categories - modality - format - library - language - license - arxiv - doi - region - other - task_ids - annotations_creators - language_creators - multilinguality - source_datasets required: false /api/trending: get: description: Get the trending repositories summary: Get trending tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: recentlyTrending: type: array items: anyOf: - type: object properties: repoType: const: dataset repoData: type: object properties: author: type: string id: type: string isLikedByUser: type: boolean likes: type: number datasetsServerInfo: type: object properties: viewer: enum: - preview - viewer-partial - viewer numRows: anyOf: - type: number - type: 'null' libraries: type: array items: enum: - mlcroissant - webdataset - datasets - pandas - dask - distilabel - fiftyone - lance - argilla - polars - duckdb - datadesigner formats: type: array items: enum: - json - csv - parquet - imagefolder - audiofolder - webdataset - text - arrow - optimized-parquet - agent-traces modalities: type: array items: enum: - 3d - audio - document - geospatial - image - tabular - text - timeseries - video required: - viewer - numRows - libraries - formats - modalities additionalProperties: false private: type: boolean repoType: const: dataset downloads: type: number gated: anyOf: - const: false - enum: - auto - manual lastModified: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ resourceGroup: type: object properties: id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ name: type: string numUsers: type: number required: - id - name additionalProperties: false isBenchmark: type: boolean isTraces: type: boolean required: - author - id - isLikedByUser - likes - private - repoType - downloads - gated - lastModified additionalProperties: false required: - repoType - repoData additionalProperties: false - type: object properties: repoType: const: model repoData: type: object properties: author: type: string downloads: type: number id: type: string availableInferenceProviders: type: array items: type: object properties: provider: enum: - baseten - black-forest-labs - cerebras - clarifai - cohere - deepinfra - fal-ai - featherless-ai - fireworks-ai - groq - hf-inference - hyperbolic - nebius - novita - nscale - nvidia - openai - ovhcloud - publicai - replicate - sambanova - scaleway - together - wavespeed - zai-org providerStatus: enum: - live - staging - error modelStatus: enum: - live - staging - error providerId: type: string task: enum: - text-classification - token-classification - table-question-answering - question-answering - zero-shot-classification - translation - summarization - feature-extraction - text-generation - fill-mask - sentence-similarity - text-to-speech - text-to-audio - automatic-speech-recognition - audio-to-audio - audio-classification - audio-text-to-text - voice-activity-detection - depth-estimation - image-classification - object-detection - image-segmentation - text-to-image - image-to-text - image-to-image - image-to-video - unconditional-image-generation - video-classification - reinforcement-learning - robotics - tabular-classification - tabular-regression - tabular-to-text - table-to-text - multiple-choice - text-ranking - text-retrieval - time-series-forecasting - text-to-video - image-text-to-text - image-text-to-image - image-text-to-video - visual-question-answering - document-question-answering - zero-shot-image-classification - graph-ml - mask-generation - zero-shot-object-detection - text-to-3d - image-to-3d - image-feature-extraction - video-text-to-text - keypoint-detection - visual-document-retrieval - any-to-any - video-to-video - other - conversational adapterType: const: lora adapterWeightsPath: type: string features: type: object properties: toolCalling: type: boolean additionalProperties: false isCheapestPricingOutput: type: boolean isFastestThroughput: type: boolean isModelAuthor: type: boolean tokensPerSecond: type: number pricingOutput: type: number required: - provider - providerStatus - modelStatus - providerId - task - isCheapestPricingOutput - isFastestThroughput - isModelAuthor additionalProperties: false isLikedByUser: type: boolean lastModified: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ likes: type: number pipeline_tag: type: string private: type: boolean repoType: const: model gated: anyOf: - const: false - enum: - auto - manual resourceGroup: type: object properties: id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ name: type: string numUsers: type: number required: - id - name additionalProperties: false numParameters: type: number authorData: anyOf: - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: org plan: enum: - team - enterprise - plus - academia isUserFollowing: type: boolean required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type additionalProperties: false - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: user isPro: type: boolean isUserFollowing: type: boolean primaryOrg: type: object properties: avatarUrl: type: string fullname: type: string name: type: string type: const: org isHf: type: boolean isFollowing: type: boolean plan: enum: - team - enterprise - plus - academia details: type: string hasPrivateMembersList: type: boolean userRole: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string numUsers: type: number required: - avatarUrl - fullname - name - type - isHf additionalProperties: false required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type - isPro additionalProperties: false widgetOutputUrls: type: array items: type: string format: uri required: - author - downloads - id - availableInferenceProviders - isLikedByUser - lastModified - likes - private - repoType - gated additionalProperties: false required: - repoType - repoData additionalProperties: false - type: object properties: repoType: const: space repoData: type: object properties: author: type: string colorFrom: type: string colorTo: type: string createdAt: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ emoji: type: string id: type: string isLikedByUser: type: boolean lastModified: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ likes: type: number pinned: type: boolean private: type: boolean repoType: const: space title: type: string sdk: enum: - gradio - docker - static - streamlit runtime: type: object properties: stage: enum: - NO_APP_FILE - CONFIG_ERROR - BUILDING - BUILD_ERROR - APP_STARTING - RUNNING - RUNNING_BUILDING - RUNNING_APP_STARTING - RUNTIME_ERROR - DELETING - STOPPED - PAUSED - SLEEPING hardware: type: object properties: current: anyOf: - enum: - cpu-basic - cpu-upgrade - cpu-performance - cpu-xl - sprx8 - zero-a10g - t4-small - t4-medium - l4x1 - l4x4 - l40sx1 - l40sx4 - l40sx8 - a10g-small - a10g-large - a10g-largex2 - a10g-largex4 - a100-large - a100x4 - a100x8 - h200 - h200x2 - h200x4 - h200x8 - rtx-pro-6000 - rtx-pro-6000x2 - rtx-pro-6000x4 - rtx-pro-6000x8 - inf2x6 - type: 'null' requested: anyOf: - enum: - cpu-basic - cpu-upgrade - cpu-performance - cpu-xl - sprx8 - zero-a10g - t4-small - t4-medium - l4x1 - l4x4 - l40sx1 - l40sx4 - l40sx8 - a10g-small - a10g-large - a10g-largex2 - a10g-largex4 - a100-large - a100x4 - a100x8 - h200 - h200x2 - h200x4 - h200x8 - rtx-pro-6000 - rtx-pro-6000x2 - rtx-pro-6000x4 - rtx-pro-6000x8 - inf2x6 - type: 'null' required: - current - requested additionalProperties: false errorMessage: type: string gcTimeout: anyOf: - type: number - type: 'null' replicas: type: object properties: current: anyOf: - type: number - type: 'null' requested: anyOf: - type: number - const: auto required: - requested additionalProperties: false devMode: type: boolean domains: type: array items: type: object properties: domain: type: string isCustom: anyOf: - type: boolean - type: 'null' stage: enum: - READY - PENDING - PENDING_CHALLENGE - EXPIRED_CHALLENGE required: - domain - stage additionalProperties: false sha: type: string hotReloading: type: object properties: status: type: string replicaStatuses: type: array items: type: array prefixItems: - type: string - anyOf: - type: string - type: 'null' required: - status - replicaStatuses additionalProperties: false required: - stage - hardware - replicas additionalProperties: false originRepo: type: object properties: author: anyOf: - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: org plan: enum: - team - enterprise - plus - academia isUserFollowing: type: boolean required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type additionalProperties: false - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: user isPro: type: boolean isUserFollowing: type: boolean primaryOrg: type: object properties: avatarUrl: type: string fullname: type: string name: type: string type: const: org isHf: type: boolean isFollowing: type: boolean plan: enum: - team - enterprise - plus - academia details: type: string hasPrivateMembersList: type: boolean userRole: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string numUsers: type: number required: - avatarUrl - fullname - name - type - isHf additionalProperties: false required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type - isPro additionalProperties: false name: type: string required: - author - name additionalProperties: false ai_short_description: type: string ai_category: type: string trendingScore: type: number resourceGroup: type: object properties: id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ name: type: string numUsers: type: number required: - id - name additionalProperties: false tags: type: array items: type: string authorData: anyOf: - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: org plan: enum: - team - enterprise - plus - academia isUserFollowing: type: boolean required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type additionalProperties: false - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ avatarUrl: type: string fullname: type: string name: type: string isHf: type: boolean isHfAdmin: type: boolean isMod: type: boolean followerCount: type: number type: const: user isPro: type: boolean isUserFollowing: type: boolean primaryOrg: type: object properties: avatarUrl: type: string fullname: type: string name: type: string type: const: org isHf: type: boolean isFollowing: type: boolean plan: enum: - team - enterprise - plus - academia details: type: string hasPrivateMembersList: type: boolean userRole: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string numUsers: type: number required: - avatarUrl - fullname - name - type - isHf additionalProperties: false required: - _id - avatarUrl - fullname - name - isHf - isHfAdmin - isMod - type - isPro additionalProperties: false shortDescription: type: string semanticRelevancyScore: type: number featured: type: boolean visibility: enum: - public - private - protected required: - author - colorFrom - colorTo - createdAt - emoji - id - isLikedByUser - lastModified - likes - pinned - private - repoType - title - runtime - tags - featured - visibility additionalProperties: false required: - repoType - repoData additionalProperties: false required: - recentlyTrending additionalProperties: false description: Trending repos parameters: - name: type in: query schema: default: all enum: - all - dataset - model - space required: false - name: limit in: query schema: default: 10 type: integer minimum: 1 maximum: 20 required: false /datasets/{namespace}/{repo}/resolve/{rev}/{path}: get: description: This endpoint requires to follow redirection summary: Resolve a file tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: hash: description: The XET hash of the file type: string refreshUrl: description: The XET auth URL for the file type: string reconstructionUrl: description: The XET reconstruction URL for the file type: string etag: description: The ETag of the file type: string size: description: The size of the file type: number required: - hash - refreshUrl - reconstructionUrl - etag - size additionalProperties: false description: The XET file info only available if the accept header is set to application/vnd.xet-fileinfo+json '302': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Redirection to file '304': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Not modified '307': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Redirection to Xet endpoint parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: path in: path required: true schema: type: string description: Wildcard path parameter - name: Range in: header schema: $schema: https://json-schema.org/draft/2020-12/schema description: The range in bytes of the file to download type: string - name: Accept in: header schema: $schema: https://json-schema.org/draft/2020-12/schema description: Returns json information about the XET file info - if the file is a xet file const: application/vnd.xet-fileinfo+json /api/resolve-cache/datasets/{namespace}/{repo}/{rev}/{path}: get: description: This endpoint requires to follow redirection summary: Resolve a file tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: hash: description: The XET hash of the file type: string refreshUrl: description: The XET auth URL for the file type: string reconstructionUrl: description: The XET reconstruction URL for the file type: string etag: description: The ETag of the file type: string size: description: The size of the file type: number required: - hash - refreshUrl - reconstructionUrl - etag - size additionalProperties: false description: The XET file info only available if the accept header is set to application/vnd.xet-fileinfo+json '302': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Redirection to file '304': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Not modified '307': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Redirection to Xet endpoint parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: rev in: path required: true schema: type: string - name: path in: path required: true schema: type: string description: Wildcard path parameter - name: Range in: header schema: $schema: https://json-schema.org/draft/2020-12/schema description: The range in bytes of the file to download type: string - name: Accept in: header schema: $schema: https://json-schema.org/draft/2020-12/schema description: Returns json information about the XET file info - if the file is a xet file const: application/vnd.xet-fileinfo+json /datasets/{namespace}/{repo}/ask-access: post: description: Request access to a gated repository. The fields requested by repository card metadata (https://huggingface.co/docs/hub/en/models-gated#customize-requested-information) summary: Request access tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object propertyNames: type: string additionalProperties: {} responses: '303': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: Redirection to the repo parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /datasets/{namespace}/{repo}/user-access-report: get: description: Export a report of all access requests for a gated repository summary: Export access report tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: The report of all access requests for a gated repository headers: Content-Disposition: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: The filename of the report parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/user-access-request/cancel: post: description: Cancel the current user's access request to a gated repository summary: Cancel access request tags: - datasets parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/user-access-request/{status}: get: description: List access requests for a gated repository summary: List access requests tags: - datasets responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: user: type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ orgs: type: array items: type: object properties: id: type: string name: type: string fullname: type: string avatarUrl: type: string required: - id - name - fullname - avatarUrl additionalProperties: false avatarUrl: type: string fullname: type: string isPro: type: boolean user: type: string numModels: type: number numDatasets: type: number numSpaces: type: number numDiscussions: type: number numPapers: type: number numUpvotes: type: number numLikes: type: number numFollowers: type: number numFollowing: type: number details: type: string isFollowing: type: boolean reasonToFollow: type: string type: const: user email: type: string verifiedOrgNames: type: array items: type: string required: - _id - avatarUrl - fullname - isPro - user - type - verifiedOrgNames additionalProperties: false grantedBy: anyOf: - type: object properties: _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ orgs: type: array items: type: object properties: id: type: string name: type: string fullname: type: string avatarUrl: type: string required: - id - name - fullname - avatarUrl additionalProperties: false avatarUrl: type: string fullname: type: string isPro: type: boolean user: type: string numModels: type: number numDatasets: type: number numSpaces: type: number numDiscussions: type: number numPapers: type: number numUpvotes: type: number numLikes: type: number numFollowers: type: number numFollowing: type: number details: type: string isFollowing: type: boolean reasonToFollow: type: string type: const: user email: type: string required: - _id - avatarUrl - fullname - isPro - user - type additionalProperties: false - type: object properties: {} additionalProperties: false status: enum: - accepted - rejected - pending fields: type: object propertyNames: type: string additionalProperties: type: string timestamp: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ reviewedAt: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ required: - status - timestamp additionalProperties: false description: List of access requests for the gated repository headers: Link: schema: $schema: https://json-schema.org/draft/2020-12/schema type: string description: Link header for pagination, can contain a `rel="next"` link parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string - name: status in: path required: true schema: type: string enum: - pending - accepted - rejected - name: limit in: query schema: default: 1000 type: integer minimum: 10 maximum: 1000 required: false - name: after in: query schema: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ required: false - name: before in: query schema: type: string format: date-time pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$ required: false /api/datasets/{namespace}/{repo}/user-access-request/handle: post: description: Handle a user's access request to a gated repository summary: Handle access request tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: userId: description: Either userId or user must be provided type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ user: description: Either userId or user must be provided type: string status: enum: - accepted - rejected - pending rejectionReason: type: string maxLength: 200 required: - status parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/user-access-request/batch: post: description: Accept or reject up to 100 access requests for a single gated repository in one call. The same `status` (and optional `rejectionReason`) is applied to every request in the list. summary: Handle access requests in batch tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: status: enum: - accepted - rejected rejectionReason: type: string maxLength: 200 requests: minItems: 1 maxItems: 100 type: array items: type: object properties: userId: description: Either userId or user must be provided type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ user: description: Either userId or user must be provided type: string required: - status - requests responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: userId: type: string user: type: string ok: type: boolean error: enum: - user_not_found - request_not_found required: - ok additionalProperties: false description: Per-request outcomes, in the same order as the input requests array. parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string /api/datasets/{namespace}/{repo}/user-access-request/grant: post: description: Grant access to a user for a gated repository summary: Grant access tags: - datasets requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema description: The user to grant access to either by userId or user type: object properties: userId: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ user: type: string parameters: - name: namespace in: path required: true schema: type: string - name: repo in: path required: true schema: type: string components: securitySchemes: bearerAuth: type: http scheme: bearer