A terminal must be open and
curl must be installed. If either is unfamiliar, read API basics first — it covers both in a few minutes.Step 1. Set up the API token
If the token has not been created yet, follow Authentication to create one in the Gcore Customer Portal and copy the value. Then set it as an environment variable in the terminal:29841_c767... with the actual token value copied in Step 1.
Verify the variable was set correctly:
Step 2. Find the project ID
Cloud API URLs include a project ID — a number that identifies the account’s project. List the projects to find it:- curl
- Python SDK
- Go SDK
- JavaScript
The API returns:
"id" value in the results array — that number is the project ID. Copy it and set the appropriate variable for the method being used:
1234567 with the actual ID from the response.
Most accounts have one project named “Default”, while multiple projects are used to separate environments (production, staging) or billing.
Step 3. Select a region
Cloud resources — VMs, volumes, networks — exist in a specific region (a data center location), and different regions support different features. List all available regions:- curl
- Python SDK
- Go SDK
- JavaScript
The API returns a list of regions. Each entry looks like:
Find a region close to the target users, confirm it has
"has_kvm": true for VM workloads, and note its "id". Set the appropriate variable for the method being used:
148 with the chosen region’s id.
Step 4. Make a resource call
With the token and project ID set, list the VMs in the project:- curl
- Python SDK
- Go SDK
- JavaScript
The API returns:
200 OK response with valid JSON confirms the token and project ID.
Environment variables reference
The token and project ID from Steps 1 and 2 are required for a Cloud API call. A call that targets one region also sends the region ID, in the body or asregion_ids.
curl and JavaScript — the project ID is in the instance path:
region_id in the body.
Go SDK — all three values are read automatically by gcore.NewClient(), the same way the Python SDK reads them:
region_id in the body.
Resource creation is asynchronous — the response returns a task ID, not the finished resource.