https://cloud-api.near.ai.
All examples use https://cloud-platform.near.ai. Ids such as ORG_ID are UUIDs returned by earlier calls.
Credentials
Calls that need a credential sendAuthorization: Bearer <credential>. Which credential a call takes depends on the call:
Tokens issued by cloud-api are not accepted by cloud-platform. Sign in against cloud-platform as shown below. Unless a section says otherwise, the examples use
$ACCESS_TOKEN.
Sign in from a script or agent
GitHub or Google
- Open
https://cloud-platform.near.ai/v1/auth/github(or/v1/auth/google) in a browser. It redirects to the provider. - After you approve, the provider sends the browser to
/v1/auth/callback, which answers with JSON:
- Copy
access_tokenandrefresh_tokeninto your environment:
NEAR wallet
Sign a NEP-413 message with your wallet, then post the signature and the payload that was signed:Refresh the access token
When the access token stops working (HTTP 401), exchange the refresh token for a new one:Sign out and revoke
NEAR_AI_API_KEY as above deletes that key, so only run it when you want the key gone. /v1/auth/revoke revokes only the credential in the header and answers with its kind and id. To manage your signed-in sessions:
Your account
id, email, username, display_name, avatar_url, auth_provider) and the organizations and workspaces you belong to, each organization with your role. Use it to find the ids for the calls below.
GET /v1/users/me/status checks that the account is in good standing. PUT /v1/users/me/profile with display_name and avatar_url updates your profile.
Organizations and workspaces
An organization owns the balance and the members. Workspaces inside it own API keys.PUT /v1/organizations/{org_id} or PUT /v1/workspaces/{workspace_id} (send only the fields to change). DELETE on the same paths deletes them. Read one with GET /v1/organizations/{org_id} or GET /v1/workspaces/{workspace_id}.
Organization settings
PATCH. For each field, leaving it out changes nothing and null restores the default. Only owners and admins can change model restrictions.
The response also lists each model’s long-context state under
long_context (read-only).
API keys
API keys belong to a workspace. They authenticate inference requests onhttps://cloud-api.near.ai.
key (it begins with sk-). It is shown only in this response and cannot be retrieved again. Store it right away.
Members and invitations
Roles areowner, admin and member.
results, with success, email_sent and, if it failed, an error.
Accept an invitation
The invited user signs in and then either lists their pending invitations and accepts one by id:POST /v1/users/me/invitations/{invitation_id}/decline.
Usage and billing
Reads take the session access token. Dates are ISO 8601; ranges may not exceed 366 days.total_cost and total_spent are in nano-dollars (10^-9 USD); *_display fields are human readable. History for a single key is at GET /v1/workspaces/{workspace_id}/api-keys/{api_key_id}/usage/history.
Cost of individual requests
Each history entry has aninference_id. Inference responses also carry it in the inference-id header. Send up to 10,000 of these ids with an API key (not an access token) to get their costs:
warning. Usage can take a few seconds to appear after a request finishes. This call is served by https://cloud-platform.near.ai; the copy on https://cloud-api.near.ai will be removed on 2026-12-07, together with the usage balance endpoint. See the migration guide.
Reporting tokens
A reporting token (rpt-...) is a read-only credential for usage reporting, separate from API keys. Owners and admins manage them with an access token:
token value is shown only in the create response. See the Usage Reporting API for how reporting tokens are used.
Next steps
- The Cloud Platform API reference lists every request and response field.
- Moving existing scripts from cloud-api? See Cloud Platform migration.