How to Generate an API Key

API Key Overview

Security information: API Key are like passwords, they allow total access to your account, do no share them! If you believe one of your keys was compromised, delete it and create a new one.

API Key are unique identifiers associated with your Scaleway projects and consist of an Access Key and a Secret Key. The Secret key is required to authenticate against our API and will only be displayed when you create the API Key. Make sure to take a note of it and to keep it secret.

What are Access Key and Secret Key?

Before you can start using our API, you need to generate a Secret key and Access Key pair. Consider the Access Key as a login, and the Secret key as a password.

  • An Access Key can identify a token.
  • It’s not a sensitive piece of information.
  • The Secret Key is the value that can be used to authenticate against the API (the value used in X-Auth-Token HTTP header).
  • The secret must stay secret and not given to anyone or publish online.

Each Scaleway project can have several API Key (so several pairs of access-key + secret). Several API Key are useful to give different applications access to the same Scaleway project. However, you remain in control and you can revoke access to any application individually.

How to generate an API Key?

1 . To create an API Key for your project, click on the Credentials tab of the Project dashboard.

2 . Scroll down to the API Key section.

Click on Generate new API Key and a pop-up appears giving you the option of adding the API Key purpose (for internal organization). Click on Generate API Key to proceed.

The Access and Secret Key will show on your screen. Take a note of the Secret Key as it will not be recoverable.

Click OK to conclude.

Retrieving your Project ID

Our system attributes a project ID to each user. If you are using Scaleway Developer Tools you will need to retrieve the project ID for certain actions such as cloud resources (instance, cluster, etc.) creations.

The ProjectID can be found on the Project Credentials page.

To retrieve your project ID via the API, execute the following request.

N.B.: Replace the $ACCESS_KEY and $SECRET_KEY values respectively with your generated access key and secret key.

$ curl$ACCESS_KEY -H "X-Auth-Token: $SECRET_KEY"

You will find your Project ID in the output.

  "token": {
    "access_key": "FNQQWFG4H14LBB2ULPIT", 
    "user_id": "4fg6j8li-wr19-13x5-lip8-qacg67bnjdgv", 
    "expires": null, 
    "creation_date": "2020-09-16T14:12:37.273736+00:00", 
    "creation_ip": "XXX.XXX.XXX.XX", 
    "category": "user_created", 
    "deletion_date": null, 
    "inherits_user_perms": false, 
    "roles": {
      "role": null, "organization": null
    "description": "my_project", 
    "project_id": "a1543bb6-d9f8-8955-079f4-7f777bea2f7f", 
    "organization_id": "a1543bb6-d9f8-8955-079f4-7f777bea2f7f", 
    "use_role_key": true

In the example above, the Project ID is a1543bb6-d9f8-8955-079f4-7f777bea2f7f.

Discover the Cloud That Makes Sense