> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tokens

export const Comments = ({children}) => {
  return <div class="my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10" data-callout-type="comments">
      <div class="w-4">
        <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" aria-label="Comments">
            <path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM280 400C266.7 400 256 410.7 256 424C256 437.3 266.7 448 280 448L360 448C373.3 448 384 437.3 384 424C384 410.7 373.3 400 360 400L352 400L352 312C352 298.7 341.3 288 328 288L280 288C266.7 288 256 298.7 256 312C256 325.3 266.7 336 280 336L304 336L304 400L280 400zM320 256C337.7 256 352 241.7 352 224C352 206.3 337.7 192 320 192C302.3 192 288 206.3 288 224C288 241.7 302.3 256 320 256z" />
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

Control who can access packages in a channel by associating the channel with a [group](/tools/anaconda-org/admin-guide/groups). This allows you to set separate permissions per package.

You can further control access to your packages within organizations and groups with <Tooltip tip="An access control token is a random alphanumeric string that is inserted into a package or channel URL. Tokens can be used with Anaconda.org, the Anaconda Premium Repository, or the AE4 Repository. The token allows you to download a package or add a channel that are restricted.">tokens</Tooltip>. Tokens control access to private repositories, collections, or packages on Anaconda.org. Additionally, the degree of access a token grants is completely configurable at the time of generation. You can generate multiple tokens to control which groups of users have access to certain features if they have the appropriate token.

<Note>
  Individual paid plans with private packages are a legacy offering from Anaconda.org that are no longer available. However, anyone who had private packages in the past still has the ability to have those hosted privately.
</Note>

## Generating tokens

Tokens provide varying degrees of access to content within a specified <Tooltip tip="A location (URL or file path) in a repository where conda looks for packages.">channel</Tooltip> depending on the scope assignment. If you need to separate permission levels by package, you can create an [organization](/tools/anaconda-org/admin-guide/organizations) and [groups](/tools/anaconda-org/admin-guide/groups) within that organization.

<Note>
  By default, tokens expire after one year.
</Note>

<Tabs>
  <Tab title="CLI">
    1. Open [Anaconda Prompt](/reference/glossary#anaconda-prompt) (Terminal on macOS/Linux) and run the following command:

       ```sh theme={null}
       anaconda auth --create --name <YOUR_TOKEN_NAME> --scopes '<SCOPE1> <SCOPE2>'
       ```

           <Comments>
             Replace \<YOUR\_TOKEN\_NAME> with a name of your choosing.<br />
             Replace \<SCOPE> with a scope(s) from the Scopes dropdown below.
           </Comments>

       This command generates a random alphanumeric string. That string is your token! You can distribute your token to other Anaconda.org users to provide them with a specific, limited set of permissions to interact with your Anaconda.org assets.

    2. Add the token to your channel path in your .condarc file by running the following command:

       ```sh theme={null}
       conda config --add channels https://conda.anaconda.org/t/<TOKEN>/<CHANNEL>
       ```

           <Comments>
             Replace \<TOKEN> with your token string.<br />
             Replace \<CHANNEL> with the channel name.
           </Comments>

       Or, add a channel with a token and a <Tooltip tip="Part of the URLs on Anaconda.org where conda looks for packages. Labels are searched only if you specify a label.">label</Tooltip>:

       ```sh theme={null}
       conda config --add channels https://conda.anaconda.org/t/<TOKEN>/<CHANNEL>/label/<YOUR_TOKEN_NAME>
       ```

           <Comments>
             Replace \<TOKEN> with your token string.<br />
             Replace \<CHANNEL> with the channel name.<br />
             Replace \<YOUR\_TOKEN\_NAME> with the label name used in the previous step.
           </Comments>

    <Accordion title="Scopes">
      Assign scopes to tokens to set permission levels for token holders. Scopes are provided as a space-separated, quoted list.

      Available scopes:

      | Scope              | Permission                                                                         |
      | :----------------- | :--------------------------------------------------------------------------------- |
      | `all`              | Allow all operations                                                               |
      | `repos`            | Allow access to all package repositories                                           |
      | `pypi`             | Allow all operations on Standard Python repositories                               |
      | `pypi:upload`      | Provides upload permissions to Standard Python repositories                        |
      | `pypi:download`    | Provides download permissions for private packages in Standard Python repositories |
      | `conda`            | Allow all operations on conda repositories                                         |
      | `conda:download`   | Provides download permissions for private packages in conda repositories           |
      | `api`              | Allow all API operations                                                           |
      | `api:write`        | Provides write permissions to actions performed via API                            |
      | `api:read`         | Provides read permissions to actions performed via API                             |
      | `api:modify-group` | Provides manage permissions to groups via the API                                  |
    </Accordion>
  </Tab>

  <Tab title="Anaconda.org">
    1. Log in to Anaconda.org.

    2. From your profile in the top-right corner, select **Settings**.

    3. Click **Access** in the left-hand menu.

    4. Fill out the Create access token form:

       1. Provide a unique token name.
       2. Set your token strength to `strong (longer token)`. This generates a strong, completely unique token that is difficult to guess with brute force methods.
       3. Set the required scopes for your use case.
       4. Set the expiration date.

       A notification appears containing your token.

           <Tip>
             You can view the token at any time at the bottom of the **Access** page.
           </Tip>

    5. Click **Create**.
  </Tab>
</Tabs>

<Note>
  If your token expires, [revoke the token](#revoking-tokens) and create a new one.
</Note>

## Revoking tokens

You can revoke tokens directly on Anaconda.org or from the command line interface (CLI).

<Tabs>
  <Tab title="CLI">
    1. Open [Anaconda Prompt](/reference/glossary#anaconda-prompt) (Terminal on macOS/Linux) and run the following command:

       ```sh theme={null}
       anaconda auth --remove <YOUR_TOKEN_NAME>
       ```

           <Comments>
             Replace \<YOUR\_TOKEN\_NAME> with the name of the token you want to revoke.
           </Comments>
  </Tab>

  <Tab title="Anaconda.org">
    1. Log in to Anaconda.org.
    2. From your profile in the top-right corner, select **Settings**.
    3. Click **Access** in the left-hand menu.
    4. At the bottom of the page, click the name of the token you want to revoke.
    5. Click **Revoke Token**.
  </Tab>
</Tabs>
