Authorization: Bearer <token> header — requests without a valid credential are rejected before they reach any forecast data. You can authenticate with either a short-lived session token obtained by exchanging your username and password, or a long-lived API key generated from the dashboard.
Obtaining a Token
Exchange your Nexenergie username (email address) and password for an access token by callingPOST /auth/token. The request body must be sent as application/x-www-form-urlencoded.
200 with the following JSON body:
Response
string
The Bearer token to include in the
Authorization header of every subsequent API request.string
Always
"bearer".integer
Number of seconds until the token expires. Session tokens are valid for 86 400 seconds (24 hours).
Using Your Token
Pass the token in theAuthorization header as Bearer <token> on every request to the Nexenergie API.
API Keys
For production applications and automated pipelines, use a long-lived API key instead of a session token. API keys do not expire automatically and are easier to rotate on a schedule you control. To generate an API key:- Log in to the Nexenergie dashboard.
- Navigate to Account → API Keys (or go to app.nexenergie.ai/account/api-keys).
- Click Generate New Key, enter a descriptive label, and click Create.
- Copy the key immediately — it is displayed in full only once.
Authorization: Bearer <api-key> header. There is no difference in the request format between the two credential types.
Token Expiry
Session tokens obtained viaPOST /auth/token expire after 24 hours (expires_in: 86400). After expiry, any request using that token returns 401 Unauthorized. Re-authenticate by calling POST /auth/token again with your credentials to obtain a fresh token.
Long-lived API keys do not have an automatic expiry. You can revoke and replace them at any time from the dashboard.