Every Gcore API request requires a permanent API token. The token goes in theDocumentation Index
Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header and works across all products — Cloud, CDN, DNS, Storage, and others.
Step 1. Create a token
- Open the Gcore Customer Portal and sign in.
- Click the account icon in the top-right corner and go to Profile.
- Select the API tokens tab.
- Click Create token.
- Give the token a name, choose a role (use
Administratorsfor full access), and set an expiration date if needed. - Click Create. A dialog shows the token value — copy it before closing. It will not be shown again.
The token value is shown only once — store it somewhere secure (a password manager or secrets vault) before closing the dialog.
Step 2. Set the token as an environment variable
Store the token in an environment variable so it can be used in every command without re-typing or hardcoding it in scripts. Open a terminal and run:29841\$c767... with the actual token value copied in Step 1.
Environment variables are session-scoped — they disappear when the terminal is closed, so to persist across sessions, add the
export line to ~/.zshrc (macOS/Linux) or the PowerShell profile file (Windows).Not sure what these concepts mean? API basics covers terminals and environment variables from scratch.Step 3. Verify the token
Confirm the token is valid and see which account it belongs to:- curl
- Python SDK
- Go SDK
- JavaScript
"status": "active" and contains an email address, the token is working.
Common authentication errors
If the command returns an error instead, the table below shows the most common causes:| Error message | Cause | Fix |
|---|---|---|
Authentication credentials were not provided. | No Authorization header sent | Check that -H "Authorization: APIKey $GCORE_API_KEY" is present |
Bad permanent token: 29841 | Token was truncated at the $ character | Escape the $ when setting the variable: 29841\$c767... |
Token is invalid or expired | Token was deleted or has passed its expiry date | Create a new token in the portal |
Given token not valid for any token type | Using Bearer instead of APIKey | The scheme must be APIKey, not Bearer |
Authorization header name is case-insensitive — Authorization, authorization, and AUTHORIZATION all work — while the APIKey prefix is not optional.
Token roles
When creating a token, a role is assigned that controls what the token can do:| Role | Access level |
|---|---|
| Administrators | Full read and write access to all resources |
| Engineers | Technical operations; no billing or user management |
| Users | Read access to most resources; limited write access |
Administrators is typically required.
Token expiration and limits
- Maximum 50 tokens per account.
- Tokens expiring within 7 days trigger email notifications at 7 days and 1 day before expiry.
- To rotate a token, create a new one first, update all integrations, then delete the old one.