Learn how to create and manage your IonQ API keys for secure access through SDKs and APIs.
Open the System Properties Control Panel
Windows + R
to open the Run prompt, type in sysdm.cpl
and click OK
.Add your environment variable
Advanced
tab and click on the Environment Variables
button in the System Properties window.Click on the New...
button to open the New User Variable
box, where you can add your variable.Give your variable a suitable name and paste in the value provided by the IonQ application.Using your environment variable
%IONQ_API_KEY%
. In your Python code, you can use os.getenv('IONQ_API_KEY')
as a function to retrieve the stored value.setx
command:
export
command in the command line, like so:
.zshrc
(for the zsh shell). Most Linux distributions use .bashrc
(for the bash shell). Once you’ve added the variable to your profile configuration file, all new terminal sessions will have access to it.
~
keyword. For example, to open a zsh
profile in the editor nano, you could run nano ~/.zshrc
.$IONQ_API_KEY
. To retrieve the value in your Python code, use the os.getenv('IONQ_API_KEY')
function.