---
title: "Create a new repository"
method: POST
path: "/api/repos/create"
tags: ["repos"]
---

# Create a new repository

`POST /api/repos/create`

## Request body

- union
  - object
    - `name` string, required
    - `organization` string, nullable
    - `region` 'us' | 'eu' — The region where the repository is hosted.
    - `license` 'apache-2.0' | 'mit' | 'openrail' | 'bigscience-openrail-m' | 'creativeml-openrail-m' | 'bigscience-bloom-rail-1.0' | 'bigcode-openrail-m' | 'afl-3.0' | 'artistic-2.0' | 'bsl-1.0' | 'bsd' | 'bsd-2-clause' | 'bsd-3-clause' | 'bsd-3-clause-clear' | 'c-uda' | 'cc' | 'cc0-1.0' | 'cc-by-2.0' | 'cc-by-2.5' | 'cc-by-3.0' | 'cc-by-4.0' | 'cc-by-sa-3.0' | 'cc-by-sa-4.0' | 'cc-by-nc-2.0' | 'cc-by-nc-3.0' | 'cc-by-nc-4.0' | 'cc-by-nd-4.0' | 'cc-by-nc-nd-3.0' | 'cc-by-nc-nd-4.0' | 'cc-by-nc-sa-2.0' | 'cc-by-nc-sa-3.0' | 'cc-by-nc-sa-4.0' | 'cdla-sharing-1.0' | 'cdla-permissive-1.0' | 'cdla-permissive-2.0' | 'wtfpl' | 'ecl-2.0' | 'epl-1.0' | 'epl-2.0' | 'etalab-2.0' | 'eupl-1.1' | 'eupl-1.2' | 'agpl-3.0' | 'gfdl' | 'gpl' | 'gpl-2.0' | 'gpl-3.0' | 'lgpl' | 'lgpl-2.1' | 'lgpl-3.0' | 'isc' | 'h-research' | 'intel-research' | 'lppl-1.3c' | 'ms-pl' | 'apple-ascl' | 'apple-amlr' | 'mpl-2.0' | 'odc-by' | 'odbl' | 'openmdw-1.0' | 'openmdw-1.1' | 'openrail++' | 'osl-3.0' | 'postgresql' | 'ofl-1.1' | 'ncsa' | 'unlicense' | 'zlib' | 'pddl' | 'lgpl-lr' | 'deepfloyd-if-license' | 'fair-noncommercial-research-license' | 'llama2' | 'llama3' | 'llama3.1' | 'llama3.2' | 'llama3.3' | 'llama4' | 'grok2-community' | 'gemma' | 'unknown' | 'other' — The license of the repository. You can select 'Other' if your license is not in the list
    - `license_name` string
    - `license_link` union
      - 'LICENSE'
      - 'LICENSE.md'
      - string, uri
    - `private` boolean, nullable — Repository visibility. Defaults to public. Cannot be specified along with visibility.
    - `visibility` 'private' | 'public' | 'protected' — Repository visibility. `protected` is only supported for Spaces. Cannot be specified along with private.
    - `resourceGroupId` string, nullable
    - `files` object[]
      - `content` string, required
      - `path` string, required
      - `encoding` 'utf-8' | 'base64'
    - `type` 'dataset', required
  - object
    - `name` string, required
    - `organization` string, nullable
    - `region` 'us' | 'eu' — The region where the repository is hosted.
    - `license` 'apache-2.0' | 'mit' | 'openrail' | 'bigscience-openrail-m' | 'creativeml-openrail-m' | 'bigscience-bloom-rail-1.0' | 'bigcode-openrail-m' | 'afl-3.0' | 'artistic-2.0' | 'bsl-1.0' | 'bsd' | 'bsd-2-clause' | 'bsd-3-clause' | 'bsd-3-clause-clear' | 'c-uda' | 'cc' | 'cc0-1.0' | 'cc-by-2.0' | 'cc-by-2.5' | 'cc-by-3.0' | 'cc-by-4.0' | 'cc-by-sa-3.0' | 'cc-by-sa-4.0' | 'cc-by-nc-2.0' | 'cc-by-nc-3.0' | 'cc-by-nc-4.0' | 'cc-by-nd-4.0' | 'cc-by-nc-nd-3.0' | 'cc-by-nc-nd-4.0' | 'cc-by-nc-sa-2.0' | 'cc-by-nc-sa-3.0' | 'cc-by-nc-sa-4.0' | 'cdla-sharing-1.0' | 'cdla-permissive-1.0' | 'cdla-permissive-2.0' | 'wtfpl' | 'ecl-2.0' | 'epl-1.0' | 'epl-2.0' | 'etalab-2.0' | 'eupl-1.1' | 'eupl-1.2' | 'agpl-3.0' | 'gfdl' | 'gpl' | 'gpl-2.0' | 'gpl-3.0' | 'lgpl' | 'lgpl-2.1' | 'lgpl-3.0' | 'isc' | 'h-research' | 'intel-research' | 'lppl-1.3c' | 'ms-pl' | 'apple-ascl' | 'apple-amlr' | 'mpl-2.0' | 'odc-by' | 'odbl' | 'openmdw-1.0' | 'openmdw-1.1' | 'openrail++' | 'osl-3.0' | 'postgresql' | 'ofl-1.1' | 'ncsa' | 'unlicense' | 'zlib' | 'pddl' | 'lgpl-lr' | 'deepfloyd-if-license' | 'fair-noncommercial-research-license' | 'llama2' | 'llama3' | 'llama3.1' | 'llama3.2' | 'llama3.3' | 'llama4' | 'grok2-community' | 'gemma' | 'unknown' | 'other' — The license of the repository. You can select 'Other' if your license is not in the list
    - `license_name` string
    - `license_link` union
      - 'LICENSE'
      - 'LICENSE.md'
      - string, uri
    - `private` boolean, nullable — Repository visibility. Defaults to public. Cannot be specified along with visibility.
    - `visibility` 'private' | 'public' | 'protected' — Repository visibility. `protected` is only supported for Spaces. Cannot be specified along with private.
    - `resourceGroupId` string, nullable
    - `files` object[]
      - `content` string, required
      - `path` string, required
      - `encoding` 'utf-8' | 'base64'
    - `type` 'model'
  - object
    - `name` string, required
    - `organization` string, nullable
    - `region` 'us' | 'eu' — The region where the repository is hosted.
    - `license` 'apache-2.0' | 'mit' | 'openrail' | 'bigscience-openrail-m' | 'creativeml-openrail-m' | 'bigscience-bloom-rail-1.0' | 'bigcode-openrail-m' | 'afl-3.0' | 'artistic-2.0' | 'bsl-1.0' | 'bsd' | 'bsd-2-clause' | 'bsd-3-clause' | 'bsd-3-clause-clear' | 'c-uda' | 'cc' | 'cc0-1.0' | 'cc-by-2.0' | 'cc-by-2.5' | 'cc-by-3.0' | 'cc-by-4.0' | 'cc-by-sa-3.0' | 'cc-by-sa-4.0' | 'cc-by-nc-2.0' | 'cc-by-nc-3.0' | 'cc-by-nc-4.0' | 'cc-by-nd-4.0' | 'cc-by-nc-nd-3.0' | 'cc-by-nc-nd-4.0' | 'cc-by-nc-sa-2.0' | 'cc-by-nc-sa-3.0' | 'cc-by-nc-sa-4.0' | 'cdla-sharing-1.0' | 'cdla-permissive-1.0' | 'cdla-permissive-2.0' | 'wtfpl' | 'ecl-2.0' | 'epl-1.0' | 'epl-2.0' | 'etalab-2.0' | 'eupl-1.1' | 'eupl-1.2' | 'agpl-3.0' | 'gfdl' | 'gpl' | 'gpl-2.0' | 'gpl-3.0' | 'lgpl' | 'lgpl-2.1' | 'lgpl-3.0' | 'isc' | 'h-research' | 'intel-research' | 'lppl-1.3c' | 'ms-pl' | 'apple-ascl' | 'apple-amlr' | 'mpl-2.0' | 'odc-by' | 'odbl' | 'openmdw-1.0' | 'openmdw-1.1' | 'openrail++' | 'osl-3.0' | 'postgresql' | 'ofl-1.1' | 'ncsa' | 'unlicense' | 'zlib' | 'pddl' | 'lgpl-lr' | 'deepfloyd-if-license' | 'fair-noncommercial-research-license' | 'llama2' | 'llama3' | 'llama3.1' | 'llama3.2' | 'llama3.3' | 'llama4' | 'grok2-community' | 'gemma' | 'unknown' | 'other' — The license of the repository. You can select 'Other' if your license is not in the list
    - `license_name` string
    - `license_link` union
      - 'LICENSE'
      - 'LICENSE.md'
      - string, uri
    - `private` boolean, nullable — Repository visibility. Defaults to public. Cannot be specified along with visibility.
    - `visibility` 'private' | 'public' | 'protected' — Repository visibility. `protected` is only supported for Spaces. Cannot be specified along with private.
    - `resourceGroupId` string, nullable
    - `files` object[]
      - `content` string, required
      - `path` string, required
      - `encoding` 'utf-8' | 'base64'
    - `type` 'kernel', required
  - object
    - `name` string, required
    - `organization` string, nullable
    - `region` 'us' | 'eu' — The region where the repository is hosted.
    - `license` 'apache-2.0' | 'mit' | 'openrail' | 'bigscience-openrail-m' | 'creativeml-openrail-m' | 'bigscience-bloom-rail-1.0' | 'bigcode-openrail-m' | 'afl-3.0' | 'artistic-2.0' | 'bsl-1.0' | 'bsd' | 'bsd-2-clause' | 'bsd-3-clause' | 'bsd-3-clause-clear' | 'c-uda' | 'cc' | 'cc0-1.0' | 'cc-by-2.0' | 'cc-by-2.5' | 'cc-by-3.0' | 'cc-by-4.0' | 'cc-by-sa-3.0' | 'cc-by-sa-4.0' | 'cc-by-nc-2.0' | 'cc-by-nc-3.0' | 'cc-by-nc-4.0' | 'cc-by-nd-4.0' | 'cc-by-nc-nd-3.0' | 'cc-by-nc-nd-4.0' | 'cc-by-nc-sa-2.0' | 'cc-by-nc-sa-3.0' | 'cc-by-nc-sa-4.0' | 'cdla-sharing-1.0' | 'cdla-permissive-1.0' | 'cdla-permissive-2.0' | 'wtfpl' | 'ecl-2.0' | 'epl-1.0' | 'epl-2.0' | 'etalab-2.0' | 'eupl-1.1' | 'eupl-1.2' | 'agpl-3.0' | 'gfdl' | 'gpl' | 'gpl-2.0' | 'gpl-3.0' | 'lgpl' | 'lgpl-2.1' | 'lgpl-3.0' | 'isc' | 'h-research' | 'intel-research' | 'lppl-1.3c' | 'ms-pl' | 'apple-ascl' | 'apple-amlr' | 'mpl-2.0' | 'odc-by' | 'odbl' | 'openmdw-1.0' | 'openmdw-1.1' | 'openrail++' | 'osl-3.0' | 'postgresql' | 'ofl-1.1' | 'ncsa' | 'unlicense' | 'zlib' | 'pddl' | 'lgpl-lr' | 'deepfloyd-if-license' | 'fair-noncommercial-research-license' | 'llama2' | 'llama3' | 'llama3.1' | 'llama3.2' | 'llama3.3' | 'llama4' | 'grok2-community' | 'gemma' | 'unknown' | 'other' — The license of the repository. You can select 'Other' if your license is not in the list
    - `license_name` string
    - `license_link` union
      - 'LICENSE'
      - 'LICENSE.md'
      - string, uri
    - `private` boolean, nullable — Repository visibility. Defaults to public. Cannot be specified along with visibility.
    - `visibility` 'private' | 'public' | 'protected' — Repository visibility. `protected` is only supported for Spaces. Cannot be specified along with private.
    - `resourceGroupId` string, nullable
    - `files` object[]
      - `content` string, required
      - `path` string, required
      - `encoding` 'utf-8' | 'base64'
    - `type` 'space', required
    - `template` string
    - `short_description` string
    - `hardware` 'cpu-basic' | 'cpu-upgrade' | 'cpu-performance' | 'cpu-xl' | 'sprx8' | 'zero-a10g' | 't4-small' | 't4-medium' | 'l4x1' | 'l4x4' | 'l40sx1' | 'l40sx4' | 'l40sx8' | 'a10g-small' | 'a10g-large' | 'a10g-largex2' | 'a10g-largex4' | 'a100-large' | 'a100x4' | 'a100x8' | 'h200' | 'h200x2' | 'h200x4' | 'h200x8' | 'rtx-pro-6000' | 'rtx-pro-6000x2' | 'rtx-pro-6000x4' | 'rtx-pro-6000x8' | 'inf2x6' | 'zerogpu' — The hardware flavor of the space. If you select 'zero-a10g' or 'zerogpu', the SDK must be Gradio.
    - `secrets` object[]
      - `key` string, required
      - `description` string
      - `value` string, required
    - `variables` object[]
      - `key` string, required
      - `description` string
      - `value` string, required
    - `sleepTimeSeconds` union
      - integer
      - unknown
    - `volumes` object[] — HuggingFace Buckets or Repos to mount as volumes in the Space container.
      - `type` 'bucket' | 'model' | 'dataset' | 'space', required
      - `source` string, required — Source identifier, e.g. 'username/my-bucket' or 'username/my-model'
      - `mountPath` string, required — Mount path inside the container, e.g. '/data'
      - `revision` string — Git revision (only for repos, defaults to 'main')
      - `readOnly` boolean — Read-only mount (true for repos, false default for buckets)
      - `path` string — Subfolder prefix inside the bucket/repo to mount, e.g. 'path/to/dir'
    - `sdk` 'gradio' | 'docker' | 'static', required — The Space SDK. `static` is free for everyone. `gradio` and `docker` run on compute: on the free `cpu-basic` flavor they require a subscription (PRO for users, Team/Enterprise for orgs), while paid hardware only requires billing (a payment method and prepaid credits).
    - `sdkVersion` string, nullable
    - `devModeEnabled` boolean

## Response `200`

Repository created, url is given

- object
  - `url` string, required
  - `name` string, required
  - `id` string, required

## Other responses

- `409` — Repository already exists, url is given

---

[API](https://skmtc.net/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.net/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huggingface/hub-api-endpoints/versions/dae0cc3790f0/schema)
