How to Generate API Keys

API Keys Overview

Security information: API keys 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 keys 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 keys (so several pairs of access-key + secret). Several API keys 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 Keys section.

Note: If you are using Scaleway Developer Tools you will need to retrieve the project ID, which can be found in the Project Credentials page.

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.

You can execute a command through our API (e.g. Create a Kubernetes cluster) with your API key and ProjectID, as such:

curl -H "X-Auth-Token: $TOKEN" -X POST https://api.scaleway.com/k8s/v1/regions/fr-par/clusters -d '{"project_id": "a1543bb6-d9i8-8955-079f4-7f777bea2g7g", "name": "test", "cni":"cilium","version":"1.19.1"}'

{
  {"region":"fr-par",
  "id":"cc6d5889-1b9f-7ttg-e113-46v12s91c4ce",
  "organization_id":"a1543bb6-d9i8-8955-079f4-7f777bea2g7g",
  "project_id":"a1543bb6-d9i8-8955-079f4-7f777bea2g7g",
  "created_at":"2020-09-11T11:52:53.894392652Z",
  "updated_at":"2020-09-11T11:52:55.588222464Z",
  "name":"test",
  "description":"$description",
  "status":"creating",
  "version":"1.19.1",
  "cni":"cilium",
  
  "tags":[
    "www",
    "prd"

  ],

  "cluster_url":"https://cc6d5889-1b9f-7ttg-e113-46v12s91c4ce.api.k8s.fr-par.scw.cloud:6443",
  "dns_wildcard":"*.cc6d5889-1b9f-7ttg-e113-46v12s91c4ce.nodes.k8s.fr-par.scw.cloud",
  "autoscaler_config":{
    "scale_down_disabled":false,
    "scale_down_delay_after_add":"10m",
    "estimator":"binpacking",
    "expander":"random",
    "ignore_daemonsets_utilization":false,
    "balance_similar_node_groups":false,
    "expendable_pods_priority_cutoff":-10,
    "scale_down_unneeded_time":"10m"
  },
    
    "dashboard_enabled":false,
    "ingress":"none","auto_upgrade":{
      "enabled":false,
      "maintenance_window":{
        "start_hour":0,"day":"any"
    }
  },
    "upgrade_available":false,"feature_gates":[

  ],
    "admission_plugins":[
    
  ]
}

Discover a New Cloud Experience

Deploy SSD Cloud Servers in seconds.