Buckets:

rtrm's picture
download
raw
94.3 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Hub API Endpoints&quot;,&quot;local&quot;:&quot;hub-api-endpoints&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;The Hub API Playground&quot;,&quot;local&quot;:&quot;the-hub-api-playground&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Repo listing API&quot;,&quot;local&quot;:&quot;repo-listing-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/models&quot;,&quot;local&quot;:&quot;get-apimodels&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/models/{repo_id} or /api/models/{repo_id}/revision/{revision}&quot;,&quot;local&quot;:&quot;get-apimodelsrepoid-or-apimodelsrepoidrevisionrevision&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/models-tags-by-type&quot;,&quot;local&quot;:&quot;get-apimodels-tags-by-type&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets&quot;,&quot;local&quot;:&quot;get-apidatasets&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id} or /api/datasets/{repo_id}/revision/{revision}&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoid-or-apidatasetsrepoidrevisionrevision&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id}/parquet&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoidparquet&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id}/parquet/{subset}/{split}/{n}.parquet&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoidparquetsubsetsplitnparquet&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id}/croissant&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoidcroissant&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets-tags-by-type&quot;,&quot;local&quot;:&quot;get-apidatasets-tags-by-type&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/spaces&quot;,&quot;local&quot;:&quot;get-apispaces&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/spaces/{repo_id} or /api/spaces/{repo_id}/revision/{revision}&quot;,&quot;local&quot;:&quot;get-apispacesrepoid-or-apispacesrepoidrevisionrevision&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Repo API&quot;,&quot;local&quot;:&quot;repo-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;POST /api/repos/create&quot;,&quot;local&quot;:&quot;post-apireposcreate&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;DELETE /api/repos/delete&quot;,&quot;local&quot;:&quot;delete-apireposdelete&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;PUT /api/repos/{repo_type}/{repo_id}/settings&quot;,&quot;local&quot;:&quot;put-apireposrepotyperepoidsettings&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;POST /api/repos/move&quot;,&quot;local&quot;:&quot;post-apireposmove&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;User API&quot;,&quot;local&quot;:&quot;user-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/whoami-v2&quot;,&quot;local&quot;:&quot;get-apiwhoami-v2&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Organization API&quot;,&quot;local&quot;:&quot;organization-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/organizations/{organization_name}/members&quot;,&quot;local&quot;:&quot;get-apiorganizationsorganizationnamemembers&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Paper Pages API&quot;,&quot;local&quot;:&quot;paper-pages-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/arxiv/{arxiv_id}/repos&quot;,&quot;local&quot;:&quot;get-apiarxivarxividrepos&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/daily_papers&quot;,&quot;local&quot;:&quot;get-apidailypapers&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Collections API&quot;,&quot;local&quot;:&quot;collections-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;POST /api/collections&quot;,&quot;local&quot;:&quot;post-apicollections&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/collections/{namespace}/{slug}-{id}&quot;,&quot;local&quot;:&quot;get-apicollectionsnamespaceslug-id&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/collections&quot;,&quot;local&quot;:&quot;get-apicollections&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;PATCH /api/collections/{namespace}/{slug}-{id}&quot;,&quot;local&quot;:&quot;patch-apicollectionsnamespaceslug-id&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;DELETE /api/collections/{namespace}/{slug}-{id}&quot;,&quot;local&quot;:&quot;delete-apicollectionsnamespaceslug-id&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;POST /api/collections/{namespace}/{slug}-{id}/item&quot;,&quot;local&quot;:&quot;post-apicollectionsnamespaceslug-iditem&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;PATCH /api/collections/{namespace}/{slug}-{id}/items/{item_id}&quot;,&quot;local&quot;:&quot;patch-apicollectionsnamespaceslug-iditemsitemid&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;DELETE /api/collections/{namespace}/{slug}-{id}/items/{item_id}&quot;,&quot;local&quot;:&quot;delete-apicollectionsnamespaceslug-iditemsitemid&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/hub/main/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/entry/start.d0cd5065.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/scheduler.d6170356.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/singletons.d032f1eb.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/paths.752f1c6b.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/entry/app.b6abe3c1.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/index.fcd4cc08.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/nodes/0.f045427f.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/nodes/5.3b0f4bed.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/Tip.b09c67cf.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/CodeBlock.7b16bdef.js">
<link rel="modulepreload" href="/docs/hub/main/en/_app/immutable/chunks/EditOnGithub.da2b595c.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Hub API Endpoints&quot;,&quot;local&quot;:&quot;hub-api-endpoints&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;The Hub API Playground&quot;,&quot;local&quot;:&quot;the-hub-api-playground&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Repo listing API&quot;,&quot;local&quot;:&quot;repo-listing-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/models&quot;,&quot;local&quot;:&quot;get-apimodels&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/models/{repo_id} or /api/models/{repo_id}/revision/{revision}&quot;,&quot;local&quot;:&quot;get-apimodelsrepoid-or-apimodelsrepoidrevisionrevision&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/models-tags-by-type&quot;,&quot;local&quot;:&quot;get-apimodels-tags-by-type&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets&quot;,&quot;local&quot;:&quot;get-apidatasets&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id} or /api/datasets/{repo_id}/revision/{revision}&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoid-or-apidatasetsrepoidrevisionrevision&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id}/parquet&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoidparquet&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id}/parquet/{subset}/{split}/{n}.parquet&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoidparquetsubsetsplitnparquet&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets/{repo_id}/croissant&quot;,&quot;local&quot;:&quot;get-apidatasetsrepoidcroissant&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/datasets-tags-by-type&quot;,&quot;local&quot;:&quot;get-apidatasets-tags-by-type&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/spaces&quot;,&quot;local&quot;:&quot;get-apispaces&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/spaces/{repo_id} or /api/spaces/{repo_id}/revision/{revision}&quot;,&quot;local&quot;:&quot;get-apispacesrepoid-or-apispacesrepoidrevisionrevision&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Repo API&quot;,&quot;local&quot;:&quot;repo-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;POST /api/repos/create&quot;,&quot;local&quot;:&quot;post-apireposcreate&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;DELETE /api/repos/delete&quot;,&quot;local&quot;:&quot;delete-apireposdelete&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;PUT /api/repos/{repo_type}/{repo_id}/settings&quot;,&quot;local&quot;:&quot;put-apireposrepotyperepoidsettings&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;POST /api/repos/move&quot;,&quot;local&quot;:&quot;post-apireposmove&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;User API&quot;,&quot;local&quot;:&quot;user-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/whoami-v2&quot;,&quot;local&quot;:&quot;get-apiwhoami-v2&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Organization API&quot;,&quot;local&quot;:&quot;organization-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/organizations/{organization_name}/members&quot;,&quot;local&quot;:&quot;get-apiorganizationsorganizationnamemembers&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Paper Pages API&quot;,&quot;local&quot;:&quot;paper-pages-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;GET /api/arxiv/{arxiv_id}/repos&quot;,&quot;local&quot;:&quot;get-apiarxivarxividrepos&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/daily_papers&quot;,&quot;local&quot;:&quot;get-apidailypapers&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Collections API&quot;,&quot;local&quot;:&quot;collections-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;POST /api/collections&quot;,&quot;local&quot;:&quot;post-apicollections&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/collections/{namespace}/{slug}-{id}&quot;,&quot;local&quot;:&quot;get-apicollectionsnamespaceslug-id&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;GET /api/collections&quot;,&quot;local&quot;:&quot;get-apicollections&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;PATCH /api/collections/{namespace}/{slug}-{id}&quot;,&quot;local&quot;:&quot;patch-apicollectionsnamespaceslug-id&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;DELETE /api/collections/{namespace}/{slug}-{id}&quot;,&quot;local&quot;:&quot;delete-apicollectionsnamespaceslug-id&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;POST /api/collections/{namespace}/{slug}-{id}/item&quot;,&quot;local&quot;:&quot;post-apicollectionsnamespaceslug-iditem&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;PATCH /api/collections/{namespace}/{slug}-{id}/items/{item_id}&quot;,&quot;local&quot;:&quot;patch-apicollectionsnamespaceslug-iditemsitemid&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;DELETE /api/collections/{namespace}/{slug}-{id}/items/{item_id}&quot;,&quot;local&quot;:&quot;delete-apicollectionsnamespaceslug-iditemsitemid&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="hub-api-endpoints" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#hub-api-endpoints"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Hub API Endpoints</span></h1> <p data-svelte-h="svelte-1carg1c">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 library, <a href="https://github.com/huggingface/huggingface_hub" rel="nofollow"><code>huggingface_hub</code></a>, that allows easy access to these endpoints. We also provide <a href="./webhooks">webhooks</a> to receive real-time incremental info about repos. Enjoy!</p> <p data-svelte-h="svelte-c2bk6n">The base URL for those endpoints below is <code>https://huggingface.co</code>. For example, to construct the <code>/api/models</code> call below, one can call the URL <a href="https://huggingface.co/api/models" rel="nofollow">https://huggingface.co/api/models</a></p> <h2 class="relative group"><a id="the-hub-api-playground" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#the-hub-api-playground"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>The Hub API Playground</span></h2> <p data-svelte-h="svelte-ag615g">Want to try out our API?
Try it out now on our <a href="https://huggingface.co/spaces/enzostvs/hub-api-playground" rel="nofollow">Playground</a>!</p> <div class="flex justify-center" data-svelte-h="svelte-25z24s"><a href="https://huggingface.co/spaces/enzostvs/hub-api-playground" target="_blank"><img class="w-full object-contain" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/hub-api-playground.png"></a></div> <h2 class="relative group"><a id="repo-listing-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#repo-listing-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Repo listing API</span></h2> <p data-svelte-h="svelte-oukbsk">The following endpoints help get information about models, datasets, Spaces, and metrics stored on the Hub.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">When making API calls to retrieve information about repositories, the <code data-svelte-h="svelte-1lly2l1">createdAt</code> attribute indicates the time when the respective repository was created. It&#39;s important to note that there is a unique value, <code data-svelte-h="svelte-17k3afp">2022-03-02T23:29:04.000Z</code> assigned to all repositories that were created before we began storing creation dates.</div> <h3 class="relative group"><a id="get-apimodels" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apimodels"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/models</span></h3> <p data-svelte-h="svelte-1ggcmi">Get information from all models in the Hub. The response is paginated, use the <a href="https://docs.github.com/en/rest/guides/using-pagination-in-the-rest-api?apiVersion=2022-11-28#link-header" rel="nofollow"><code>Link</code> header</a> to get the next pages. You can specify additional parameters to have more specific results.</p> <ul data-svelte-h="svelte-pjpp2w"><li><code>search</code>: Filter based on substrings for repos and their usernames, such as <code>resnet</code> or <code>microsoft</code></li> <li><code>author</code>: Filter models by an author or organization, such as <code>huggingface</code> or <code>microsoft</code></li> <li><code>filter</code>: Filter based on tags, such as <code>text-classification</code> or <code>spacy</code>.</li> <li><code>sort</code>: Property to use when sorting, such as <code>downloads</code> or <code>author</code>.</li> <li><code>direction</code>: Direction in which to sort, such as <code>-1</code> for descending, and anything else for ascending.</li> <li><code>limit</code>: Limit the number of models fetched.</li> <li><code>full</code>: Whether to fetch most model data, such as all tags, the files, etc.</li> <li><code>config</code>: Whether to also fetch the repo config.</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->params = {
<span class="hljs-string">&quot;search&quot;</span>:<span class="hljs-string">&quot;search&quot;</span>,
<span class="hljs-string">&quot;author&quot;</span>:<span class="hljs-string">&quot;author&quot;</span>,
<span class="hljs-string">&quot;filter&quot;</span>:<span class="hljs-string">&quot;filter&quot;</span>,
<span class="hljs-string">&quot;sort&quot;</span>:<span class="hljs-string">&quot;sort&quot;</span>,
<span class="hljs-string">&quot;direction&quot;</span>:<span class="hljs-string">&quot;direction&quot;</span>,
<span class="hljs-string">&quot;limit&quot;</span>:<span class="hljs-string">&quot;limit&quot;</span>,
<span class="hljs-string">&quot;full&quot;</span>:<span class="hljs-string">&quot;full&quot;</span>,
<span class="hljs-string">&quot;config&quot;</span>:<span class="hljs-string">&quot;config&quot;</span>
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-18czug6">This is equivalent to <code>huggingface_hub.list_models()</code>.</p> <h3 class="relative group"><a id="get-apimodelsrepoid-or-apimodelsrepoidrevisionrevision" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apimodelsrepoid-or-apimodelsrepoidrevisionrevision"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/models/{repo_id} or /api/models/{repo_id}/revision/{revision}</span></h3> <p data-svelte-h="svelte-1amgfxc">Get all information for a specific model.</p> <p data-svelte-h="svelte-11a6q7k">This is equivalent to <code>huggingface_hub.model_info(repo_id, revision)</code>.</p> <h3 class="relative group"><a id="get-apimodels-tags-by-type" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apimodels-tags-by-type"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/models-tags-by-type</span></h3> <p data-svelte-h="svelte-f44s2k">Gets all the available model tags hosted in the Hub.</p> <p data-svelte-h="svelte-snkr6p">This is equivalent to <code>huggingface_hub.get_model_tags()</code>.</p> <h3 class="relative group"><a id="get-apidatasets" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidatasets"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/datasets</span></h3> <p data-svelte-h="svelte-10tqhmd">Get information from all datasets in the Hub. The response is paginated, use the <a href="https://docs.github.com/en/rest/guides/using-pagination-in-the-rest-api?apiVersion=2022-11-28#link-header" rel="nofollow"><code>Link</code> header</a> to get the next pages. You can specify additional parameters to have more specific results.</p> <ul data-svelte-h="svelte-pwodq4"><li><code>search</code>: Filter based on substrings for repos and their usernames, such as <code>pets</code> or <code>microsoft</code></li> <li><code>author</code>: Filter datasets by an author or organization, such as <code>huggingface</code> or <code>microsoft</code></li> <li><code>filter</code>: Filter based on tags, such as <code>task_categories:text-classification</code> or <code>languages:en</code>.</li> <li><code>sort</code>: Property to use when sorting, such as <code>downloads</code> or <code>author</code>.</li> <li><code>direction</code>: Direction in which to sort, such as <code>-1</code> for descending, and anything else for ascending.</li> <li><code>limit</code>: Limit the number of datasets fetched.</li> <li><code>full</code>: Whether to fetch most dataset data, such as all tags, the files, etc.</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->params = {
<span class="hljs-string">&quot;search&quot;</span>:<span class="hljs-string">&quot;search&quot;</span>,
<span class="hljs-string">&quot;author&quot;</span>:<span class="hljs-string">&quot;author&quot;</span>,
<span class="hljs-string">&quot;filter&quot;</span>:<span class="hljs-string">&quot;filter&quot;</span>,
<span class="hljs-string">&quot;sort&quot;</span>:<span class="hljs-string">&quot;sort&quot;</span>,
<span class="hljs-string">&quot;direction&quot;</span>:<span class="hljs-string">&quot;direction&quot;</span>,
<span class="hljs-string">&quot;limit&quot;</span>:<span class="hljs-string">&quot;limit&quot;</span>,
<span class="hljs-string">&quot;full&quot;</span>:<span class="hljs-string">&quot;full&quot;</span>,
<span class="hljs-string">&quot;config&quot;</span>:<span class="hljs-string">&quot;config&quot;</span>
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1tc7dap">This is equivalent to <code>huggingface_hub.list_datasets()</code>.</p> <h3 class="relative group"><a id="get-apidatasetsrepoid-or-apidatasetsrepoidrevisionrevision" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidatasetsrepoid-or-apidatasetsrepoidrevisionrevision"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/datasets/{repo_id} or /api/datasets/{repo_id}/revision/{revision}</span></h3> <p data-svelte-h="svelte-1gv3tob">Get all information for a specific dataset.</p> <ul data-svelte-h="svelte-1uhwjpf"><li><code>full</code>: Whether to fetch most dataset data, such as all tags, the files, etc.</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->params = {<span class="hljs-string">&quot;full&quot;</span>: <span class="hljs-string">&quot;full&quot;</span>}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-i3hq8t">This is equivalent to <code>huggingface_hub.dataset_info(repo_id, revision)</code>.</p> <h3 class="relative group"><a id="get-apidatasetsrepoidparquet" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidatasetsrepoidparquet"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/datasets/{repo_id}/parquet</span></h3> <p data-svelte-h="svelte-l27zrd">Get the list of auto-converted parquet files.</p> <p data-svelte-h="svelte-nxq415">Append the subset and the split to the URL to get the list of files for a specific subset and split:</p> <ul data-svelte-h="svelte-8xpuv1"><li><code>GET /api/datasets/{repo_id}/parquet/{subset}</code></li> <li><code>GET /api/datasets/{repo_id}/parquet/{subset}/{split}</code></li></ul> <h3 class="relative group"><a id="get-apidatasetsrepoidparquetsubsetsplitnparquet" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidatasetsrepoidparquetsubsetsplitnparquet"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/datasets/{repo_id}/parquet/{subset}/{split}/{n}.parquet</span></h3> <p data-svelte-h="svelte-qm1285">Get the nth shard of the auto-converted parquet files, for a specific subset (also called “config”) and split.</p> <h3 class="relative group"><a id="get-apidatasetsrepoidcroissant" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidatasetsrepoidcroissant"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/datasets/{repo_id}/croissant</span></h3> <p data-svelte-h="svelte-1j3q23">Get the Croissant metadata. More details at <a href="https://huggingface.co/docs/datasets-server/croissant" rel="nofollow">https://huggingface.co/docs/datasets-server/croissant</a>.</p> <h3 class="relative group"><a id="get-apidatasets-tags-by-type" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidatasets-tags-by-type"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/datasets-tags-by-type</span></h3> <p data-svelte-h="svelte-tb64tz">Gets all the available dataset tags hosted in the Hub.</p> <p data-svelte-h="svelte-jio84s">This is equivalent to <code>huggingface_hub.get_dataset_tags()</code>.</p> <h3 class="relative group"><a id="get-apispaces" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apispaces"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/spaces</span></h3> <p data-svelte-h="svelte-1aig25b">Get information from all Spaces in the Hub. The response is paginated, use the <a href="https://docs.github.com/en/rest/guides/using-pagination-in-the-rest-api?apiVersion=2022-11-28#link-header" rel="nofollow"><code>Link</code> header</a> to get the next pages. You can specify additional parameters to have more specific results.</p> <ul data-svelte-h="svelte-1137zwa"><li><code>search</code>: Filter based on substrings for repos and their usernames, such as <code>resnet</code> or <code>microsoft</code></li> <li><code>author</code>: Filter models by an author or organization, such as <code>huggingface</code> or <code>microsoft</code></li> <li><code>filter</code>: Filter based on tags, such as <code>text-classification</code> or <code>spacy</code>.</li> <li><code>sort</code>: Property to use when sorting, such as <code>downloads</code> or <code>author</code>.</li> <li><code>direction</code>: Direction in which to sort, such as <code>-1</code> for descending, and anything else for ascending.</li> <li><code>limit</code>: Limit the number of models fetched.</li> <li><code>full</code>: Whether to fetch most model data, such as all tags, the files, etc.</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->params = {
<span class="hljs-string">&quot;search&quot;</span>:<span class="hljs-string">&quot;search&quot;</span>,
<span class="hljs-string">&quot;author&quot;</span>:<span class="hljs-string">&quot;author&quot;</span>,
<span class="hljs-string">&quot;filter&quot;</span>:<span class="hljs-string">&quot;filter&quot;</span>,
<span class="hljs-string">&quot;sort&quot;</span>:<span class="hljs-string">&quot;sort&quot;</span>,
<span class="hljs-string">&quot;direction&quot;</span>:<span class="hljs-string">&quot;direction&quot;</span>,
<span class="hljs-string">&quot;limit&quot;</span>:<span class="hljs-string">&quot;limit&quot;</span>,
<span class="hljs-string">&quot;full&quot;</span>:<span class="hljs-string">&quot;full&quot;</span>,
<span class="hljs-string">&quot;config&quot;</span>:<span class="hljs-string">&quot;config&quot;</span>
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-126zrpj">This is equivalent to <code>huggingface_hub.list_spaces()</code>.</p> <h3 class="relative group"><a id="get-apispacesrepoid-or-apispacesrepoidrevisionrevision" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apispacesrepoid-or-apispacesrepoidrevisionrevision"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/spaces/{repo_id} or /api/spaces/{repo_id}/revision/{revision}</span></h3> <p data-svelte-h="svelte-1amgfxc">Get all information for a specific model.</p> <p data-svelte-h="svelte-1ae6h8n">This is equivalent to <code>huggingface_hub.space_info(repo_id, revision)</code>.</p> <h2 class="relative group"><a id="repo-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#repo-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Repo API</span></h2> <p data-svelte-h="svelte-1fkinu4">The following endpoints manage repository settings like creating and deleting a repository.</p> <h3 class="relative group"><a id="post-apireposcreate" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#post-apireposcreate"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>POST /api/repos/create</span></h3> <p data-svelte-h="svelte-181hrr6">Create a repository. It’s a model repo by default.</p> <p data-svelte-h="svelte-eo06dy">Parameters:</p> <ul data-svelte-h="svelte-z1cr0o"><li><code>type</code>: Type of repo (dataset or space; model by default).</li> <li><code>name</code>: Name of repo.</li> <li><code>organization</code>: Name of organization (optional).</li> <li><code>private</code>: Whether the repo is private.</li> <li><code>sdk</code>: When the type is <code>space</code> (streamlit, gradio, docker or static)</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;type&quot;</span>:<span class="hljs-string">&quot;model&quot;</span>,
<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;name&quot;</span>,
<span class="hljs-string">&quot;organization&quot;</span>: <span class="hljs-string">&quot;organization&quot;</span>,
<span class="hljs-string">&quot;private&quot;</span>:<span class="hljs-string">&quot;private&quot;</span>,
<span class="hljs-string">&quot;sdk&quot;</span>: <span class="hljs-string">&quot;sdk&quot;</span>
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-12pivso">This is equivalent to <code>huggingface_hub.create_repo()</code>.</p> <h3 class="relative group"><a id="delete-apireposdelete" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#delete-apireposdelete"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>DELETE /api/repos/delete</span></h3> <p data-svelte-h="svelte-1l13wpb">Delete a repository. It’s a model repo by default.</p> <p data-svelte-h="svelte-eo06dy">Parameters:</p> <ul data-svelte-h="svelte-170i3il"><li><code>type</code>: Type of repo (dataset or space; model by default).</li> <li><code>name</code>: Name of repo.</li> <li><code>organization</code>: Name of organization (optional).</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;model&quot;</span>,
<span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;name&quot;</span>,
<span class="hljs-string">&quot;organization&quot;</span>: <span class="hljs-string">&quot;organization&quot;</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-fnfk3p">This is equivalent to <code>huggingface_hub.delete_repo()</code>.</p> <h3 class="relative group"><a id="put-apireposrepotyperepoidsettings" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#put-apireposrepotyperepoidsettings"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>PUT /api/repos/{repo_type}/{repo_id}/settings</span></h3> <p data-svelte-h="svelte-10gupyx">Update repo visibility.</p> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;private&quot;</span>: <span class="hljs-string">&quot;private&quot;</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1rtytiu">This is equivalent to <code>huggingface_hub.update_repo_visibility()</code>.</p> <h3 class="relative group"><a id="post-apireposmove" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#post-apireposmove"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>POST /api/repos/move</span></h3> <p data-svelte-h="svelte-g52a9">Move a repository (rename within the same namespace or transfer from user to organization).</p> <p data-svelte-h="svelte-eo06dy">Parameters:</p> <ul data-svelte-h="svelte-ejb5b4"><li><code>fromRepo</code>: repo to rename.</li> <li><code>toRepo</code>: new name of the repo.</li> <li><code>type</code>: Type of repo (dataset or space; model by default).</li></ul> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;fromRepo&quot;</span> : <span class="hljs-string">&quot;namespace/repo_name&quot;</span>,
<span class="hljs-string">&quot;toRepo&quot;</span> : <span class="hljs-string">&quot;namespace2/repo_name2&quot;</span>,
<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;model&quot;</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1sr4057">This is equivalent to <code>huggingface_hub.move_repo()</code>.</p> <h2 class="relative group"><a id="user-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#user-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>User API</span></h2> <p data-svelte-h="svelte-1w6agcl">The following endpoint gets information about a user.</p> <h3 class="relative group"><a id="get-apiwhoami-v2" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apiwhoami-v2"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/whoami-v2</span></h3> <p data-svelte-h="svelte-13o32co">Get username and organizations the user belongs to.</p> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->headers = { <span class="hljs-string">&quot;authorization&quot;</span> : <span class="hljs-string">&quot;Bearer $token&quot;</span> }<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-sg7fz8">This is equivalent to <code>huggingface_hub.whoami()</code>.</p> <h2 class="relative group"><a id="organization-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#organization-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Organization API</span></h2> <p data-svelte-h="svelte-1dib0r5">The following endpoint gets a list of the Organization members.</p> <h3 class="relative group"><a id="get-apiorganizationsorganizationnamemembers" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apiorganizationsorganizationnamemembers"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/organizations/{organization_name}/members</span></h3> <p data-svelte-h="svelte-1g3rw69">Get the organization members.</p> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->headers = { <span class="hljs-string">&quot;authorization&quot;</span> : <span class="hljs-string">&quot;Bearer $token&quot;</span> }<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-10rc2zv">This is equivalent to <code>huggingface_hub.list_organization_members()</code>.</p> <h2 class="relative group"><a id="paper-pages-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#paper-pages-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Paper Pages API</span></h2> <p data-svelte-h="svelte-1opruqm">The following endpoint gets information about a paper.</p> <h3 class="relative group"><a id="get-apiarxivarxividrepos" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apiarxivarxividrepos"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/arxiv/{arxiv_id}/repos</span></h3> <p data-svelte-h="svelte-74oi0s">Get all the models, datasets, and Spaces that refer to a paper.</p> <h3 class="relative group"><a id="get-apidailypapers" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apidailypapers"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/daily_papers</span></h3> <p data-svelte-h="svelte-1t6q9m7">Get the daily papers curated by AK and the community. It’s the equivalent of <a href="https://huggingface.co/papers" rel="nofollow">https://huggingface.co/papers</a>.</p> <h2 class="relative group"><a id="collections-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#collections-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Collections API</span></h2> <p data-svelte-h="svelte-r7uovh">Use Collections to group repositories from the Hub (Models, Datasets, Spaces and Papers) on a dedicated page.</p> <p data-svelte-h="svelte-vf27tv">You can learn more about it in the Collections <a href="./collections">guide</a>. Collections can also be managed using the Python client (see <a href="https://huggingface.co/docs/huggingface_hub/main/en/guides/collections" rel="nofollow">guide</a>).</p> <h3 class="relative group"><a id="post-apicollections" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#post-apicollections"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>POST /api/collections</span></h3> <p data-svelte-h="svelte-18xkxrt">Create a new collection on the Hub with a title, a description (optional) and a first item (optional). An item is defined by a type (<code>model</code>, <code>dataset</code>, <code>space</code> or <code>paper</code>) and an id (repo_id or paper_id on the Hub).</p> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;title&quot;</span>: <span class="hljs-string">&quot;My cool models&quot;</span>,
<span class="hljs-string">&quot;namespace&quot;</span>: <span class="hljs-string">&quot;username_or_org&quot;</span>,
<span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;Here is a shortlist of models I&#x27;ve trained.&quot;</span>,
<span class="hljs-string">&quot;item&quot;</span> : {
<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;model&quot;</span>,
<span class="hljs-string">&quot;id&quot;</span>: <span class="hljs-string">&quot;username/cool-model&quot;</span>,
}
<span class="hljs-string">&quot;private&quot;</span>: <span class="hljs-literal">false</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-ddwgao">This is equivalent to <code>huggingface_hub.create_collection()</code>.</p> <h3 class="relative group"><a id="get-apicollectionsnamespaceslug-id" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apicollectionsnamespaceslug-id"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/collections/{namespace}/{slug}-{id}</span></h3> <p data-svelte-h="svelte-hj5b20">Return information about a collection.</p> <p data-svelte-h="svelte-224ygk">This is equivalent to <code>huggingface_hub.get_collection()</code>.</p> <h3 class="relative group"><a id="get-apicollections" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-apicollections"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>GET /api/collections</span></h3> <p data-svelte-h="svelte-1jusaev">List collections from the Hub, based on some criteria. The supported parameters are:</p> <ul data-svelte-h="svelte-lzybjq"><li><code>owner</code> (string): filter collections created by a specific user or organization.</li> <li><code>item</code> (string): filter collections containing a specific item. Value must be the item_type and item_id concatenated. Example: <code>&quot;models/teknium/OpenHermes-2.5-Mistral-7B&quot;</code>, <code>&quot;datasets/rajpurkar/squad&quot;</code> or <code>&quot;papers/2311.12983&quot;</code>.</li> <li><code>sort</code> (string): sort the returned collections. Supported values are <code>&quot;lastModified&quot;</code>, <code>&quot;trending&quot;</code> (default) and <code>&quot;upvotes&quot;</code>.</li> <li><code>limit</code> (int): maximum number (100) of collections per page.</li> <li><code>q</code> (string): filter based on substrings for titles &amp; descriptions.</li></ul> <p data-svelte-h="svelte-t1vsxu">If no parameter is set, all collections are returned.</p> <p data-svelte-h="svelte-10sk6ox">The response is paginated. To get all collections, you must follow the <a href="https://docs.github.com/en/rest/guides/using-pagination-in-the-rest-api?apiVersion=2022-11-28#link-header" rel="nofollow"><code>Link</code> header</a>.</p> <div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400"><p data-svelte-h="svelte-85odl7">When listing collections, the item list per collection is truncated to 4 items maximum. To retrieve all items from a collection, you need to make an additional call using its collection slug.</p></div> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->params = {
<span class="hljs-string">&quot;owner&quot;</span>: <span class="hljs-string">&quot;TheBloke&quot;</span>,
<span class="hljs-string">&quot;item&quot;</span>: <span class="hljs-string">&quot;models/teknium/OpenHermes-2.5-Mistral-7B&quot;</span>,
<span class="hljs-string">&quot;sort&quot;</span>: <span class="hljs-string">&quot;lastModified&quot;</span>,
<span class="hljs-string">&quot;limit&quot;</span> : <span class="hljs-number">1</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-imecil">This is equivalent to <code>huggingface_hub.list_collections()</code>.</p> <h3 class="relative group"><a id="patch-apicollectionsnamespaceslug-id" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#patch-apicollectionsnamespaceslug-id"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>PATCH /api/collections/{namespace}/{slug}-{id}</span></h3> <p data-svelte-h="svelte-1n7t4ym">Update the metadata of a collection on the Hub. You can’t add or modify the items of the collection with this method. All fields of the payload are optional.</p> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;title&quot;</span>: <span class="hljs-string">&quot;My cool models&quot;</span>,
<span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;Here is a shortlist of models I&#x27;ve trained.&quot;</span>,
<span class="hljs-string">&quot;private&quot;</span>: <span class="hljs-literal">false</span>,
<span class="hljs-string">&quot;position&quot;</span>: <span class="hljs-number">0</span>, <span class="hljs-comment">// position of the collection on your profile</span>
<span class="hljs-string">&quot;theme&quot;</span>: <span class="hljs-string">&quot;green&quot;</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1x9ml85">This is equivalent to <code>huggingface_hub.update_collection_metadata()</code>.</p> <h3 class="relative group"><a id="delete-apicollectionsnamespaceslug-id" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#delete-apicollectionsnamespaceslug-id"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>DELETE /api/collections/{namespace}/{slug}-{id}</span></h3> <p data-svelte-h="svelte-1rb0k3l">Return a collection. This is a non-revertible operation. A deleted collection cannot be restored.</p> <p data-svelte-h="svelte-k6p5a5">This is equivalent to <code>huggingface_hub.delete_collection()</code>.</p> <h3 class="relative group"><a id="post-apicollectionsnamespaceslug-iditem" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#post-apicollectionsnamespaceslug-iditem"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>POST /api/collections/{namespace}/{slug}-{id}/item</span></h3> <p data-svelte-h="svelte-1mfx2c8">Add an item to a collection. An item is defined by a type (<code>model</code>, <code>dataset</code>, <code>space</code> or <code>paper</code>) and an id (repo_id or paper_id on the Hub). A note can also be attached to the item (optional).</p> <p data-svelte-h="svelte-9v02e8">Payload:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;item&quot;</span> : {
<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;model&quot;</span>,
<span class="hljs-string">&quot;id&quot;</span>: <span class="hljs-string">&quot;username/cool-model&quot;</span>,
}
<span class="hljs-string">&quot;note&quot;</span>: <span class="hljs-string">&quot;Here is the model I trained on ...&quot;</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-wjjomf">This is equivalent to <code>huggingface_hub.add_collection_item()</code>.</p> <h3 class="relative group"><a id="patch-apicollectionsnamespaceslug-iditemsitemid" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#patch-apicollectionsnamespaceslug-iditemsitemid"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>PATCH /api/collections/{namespace}/{slug}-{id}/items/{item_id}</span></h3> <p data-svelte-h="svelte-1olv11o">Update an item in a collection. You must know the item object id which is different from the repo_id/paper_id provided when adding the item to the collection. The <code>item_id</code> can be retrieved by fetching the collection.</p> <p data-svelte-h="svelte-1w1fo8u">You can update the note attached to the item or the position of the item in the collection. Both fields are optional.</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->payload = {
<span class="hljs-string">&quot;position&quot;</span>: <span class="hljs-number">0</span>,
<span class="hljs-string">&quot;note&quot;</span>: <span class="hljs-string">&quot;Here is the model I trained on ...&quot;</span>,
}<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1tuquv3">This is equivalent to <code>huggingface_hub.update_collection_item()</code>.</p> <h3 class="relative group"><a id="delete-apicollectionsnamespaceslug-iditemsitemid" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#delete-apicollectionsnamespaceslug-iditemsitemid"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>DELETE /api/collections/{namespace}/{slug}-{id}/items/{item_id}</span></h3> <p data-svelte-h="svelte-1v2xomk">Remove an item from a collection. You must know the item object id which is different from the repo_id/paper_id provided when adding the item to the collection. The <code>item_id</code> can be retrieved by fetching the collection.</p> <p data-svelte-h="svelte-1yuqykx">This is equivalent to <code>huggingface_hub.delete_collection_item()</code>.</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/hub-docs/blob/main/docs/hub/api.md" target="_blank"><span data-svelte-h="svelte-1kd6by1">&lt;</span> <span data-svelte-h="svelte-x0xyl0">&gt;</span> <span data-svelte-h="svelte-1dajgef"><span class="underline ml-1.5">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_1vatp3t = {
assets: "/docs/hub/main/en",
base: "/docs/hub/main/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/hub/main/en/_app/immutable/entry/start.d0cd5065.js"),
import("/docs/hub/main/en/_app/immutable/entry/app.b6abe3c1.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 5],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
94.3 kB
·
Xet hash:
d37c6fac4f53f942cc8e2c1da7e2f4a5237b5b7bcc2b1d9dacfd9f297021d3a3

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.