Skip to main content
API Access Tokens authenticate users and grant access to resources such as CKS clusters and VPCs. This page explains how to create, use, and manage API Access Tokens and the kubeconfig files generated alongside them, so you can authenticate kubectl to CKS clusters and keep credentials secure. The following section walks through creating an API Access Token and downloading the associated kubeconfig file.

Prerequisites

This guide assumes that you have an active CoreWeave account.

Create a new API access token

API access tokens authenticate programmatic access to CoreWeave services. Create them in the CoreWeave Cloud Console. To create a new access token, complete the following steps:
  1. In Cloud Console, navigate to Tokens, and then click the Create Token button in the upper-right corner.
  2. In the Create API Token dialog, complete the following fields to configure the token values, and then click Create:
    FieldDescription
    NameThe name of the token.
    ExpirationHow long the token remains valid.
    NoteA description for future reference.
  3. Select one of the following options:
    OptionDescription
    Token SecretCopy and store the token secret for use cases such as scraping metrics, scraping logs, self-hosted Grafana setup, or to add the token secret to an existing kubeconfig.
    KubeconfigCreate and download a kubeconfig for a specific cluster, so you can interact with the cluster using commands like kubectl. A kubeconfig can access multiple clusters when you switch contexts.
    Sensitive values such as token secrets and kubeconfig files are displayed in the Cloud Console modal only once, and they are never shown again after you close the modal. You must record them in a secure location.
    After you complete these steps, your new API access token is ready to use with CoreWeave services.

Use the kubeconfig file

After you have a kubeconfig file from the previous section, this section explains how to put it in place so kubectl can authenticate to your CKS cluster. To use the kubeconfig file, you must have the kubectl command-line tool installed. If you don’t have kubectl installed, follow the instructions in the Kubernetes documentation. To use the kubeconfig file, choose one of the following options:
  • Copy it to the default location for kubeconfig files, typically ~/.kube/config.
  • Specify the file location with the KUBECONFIG environment variable.
  • Use the --kubeconfig flag with kubectl.
See the Kubernetes documentation for more information. When the kubeconfig is in place, you can use kubectl to interact with the CKS clusters. The following command displays the merged kubeconfig that kubectl will use, which helps you verify the configuration:
kubectl config view