Kubiya LogoKubiya Developer Docs
Tutorials

API Keys

How to obtain and use Kubiya API keys for authentication

API Keys

Kubiya API keys allow you to authenticate with the Kubiya API, enabling capabilities like using the CLI, interacting with the API directly, or using the Terraform Provider.

Access the Kubiya Web Interface

Navigate to your Kubiya instance in your web browser.

Go to Your User Profile

Click on your user profile located in the bottom menu.

Show API Key

Click on "Show API Key" to reveal your API key. You can also directly access your API keys at https://app.kubiya.ai/api-keys.

API Key Location

Use the API Key

Once you have your API key, you can use it with the CLI by setting the environment variable:

export KUBIYA_API_KEY=YOUR_API_KEY

For persistent configuration, add this to your shell profile (.bashrc, .zshrc, etc.).

Keep your API key secure and never share it publicly. It provides access to your Kubiya resources.

Using API Keys with Different Tools

CLI

# Set environment variable
export KUBIYA_API_KEY=YOUR_API_KEY
 
# Verify authentication
kubiya version

Terraform Provider

Use the environment variable to authenticate with the Terraform Provider:

export KUBIYA_API_KEY=YOUR_API_KEY
terraform apply

There is no direct provider configuration option for the API token - the environment variable must be used.

API Requests

curl -X GET https://api.kubiya.ai/v1/resources \
  -H "UserKey: YOUR_API_KEY" \
  -H "Content-Type: application/json"

On this page