Jump toUpdate content
How to generate an API key
Each Scaleway Project can have several API keys, to give multiple accesses to the same Project. API keys are like passwords, they allow total access to your account - do not share them! If you ever think your API key might be compromised, delete it and create a new one.
Creating an API key can be done directly from the Scaleway console:
Scroll down to the API Key section:
Click Generate new API key. The following pop-up appears:
Add an API Key purpose (for your own reference), or leave this blank. Then click Generate API Key.
The two parts of your API Key (access key and secret key) are displayed. Take careful note of the secret key, as it will not be recoverable or viewable after this point.
Click OK to conclude.
This is an example of one way you can use your API key: to make a call to the Scaleway Authentication API. You will store your access key and secret key as environment variables. Then, you will use curl to call the Scaleway API and authenticate yourself with your API key. You will receive back a token containing information about your account, including your user_id, project_id and organization_id, among other details.
These instructions are for Linux/Mac operating systems. For Windows, when storing environment variables, use the
set command instead of
Open a terminal and execute the following commands. Replace your_access_key and your_secret_key with the access and secret keys you generated at the previous step.
You will need to repeat these
exportcommands every time you open a new shell session. To avoid the need for repetition, open your
~/.zshrcfiles in a text editor and append the export commands to the file. Save and exit the file, and perform
source ~/.zshrc) to finish.
Execute the following command:
curl https://account.scaleway.com/tokens/$SCW_ACCESS_KEY -H "X-Auth-Token: $SCW_SECRET_KEY"
You will receive a response similar to the following:
You can use your API key to authenticate yourself against the Scaleway Developer API, and use this to create and manage all your Scaleway resources.