qBraid uses configuration files to store your account credentials and settings. The main configuration file is called qbraidrc.

The qbraidrc file

The qbraidrc file is an INI-format configuration file that stores your qBraid account credentials and settings. It is located in your home directory at:

  • Linux/macOS: ~/.qbraid/qbraidrc
  • Windows: C:\Users\<username>\.qbraid\qbraidrc

These qBraid tools use the configuration file:

  • qBraid-SDK
  • qBraid-CLI
  • qBraid Jupyter Lab extensions
  • qBraid VS Code extensions

File structure

A typical qbraidrc file contains the following:

[default]
url = https://api-v2.qbraid.com/api/v1
api-key = <your-api-key>

Creating new configuration file

To create a new qbraidrc file:

qbraid configure

This interactive command:

  1. Prompts you to enter your API key
  2. Sets the qBraid API URL
  3. Creates the configuration file in the correct location

Updating configuration values

To update a specific configuration value:

qbraid configure set <field> <value>

For example, to update your API key:

qbraid configure set api-key your-new-api-key

Viewing configuration values

To view a specific configuration value:

qbraid configure get <field>

For example:

qbraid configure get api-key

To view all configuration values in your default profile:

qbraid configure list

Finding your configuration file

To locate your qbraidrc file programmatically:

from pathlib import Path

config_path = Path.home() / ".qbraid" / "qbraidrc"

print(config_path)

Security note

Your API key provides access to your qBraid account. Keep it secure and never share it with others. If you believe your API key has been compromised, you can generate a new one from your qBraid account settings and update it using the CLI commands above.

See API key security for more information.