NEAR AI Cloud: API Reference
OpenAI-compatible REST API for private, verifiable AI inference on NEAR AI Cloud
The NEAR AI Cloud API is a REST API served from a single base URL. Its documented OpenAI-compatible inference surfaces work with OpenAI SDKs by pointing them at NEAR AI.
https://cloud-api.near.ai/v1
Authentication
Every request is authenticated with a bearer token in the Authorization header. The API
accepts four token types; for programmatic access you almost always want an API key.
| Token | Prefix | Use for |
|---|---|---|
| API key | sk- |
Programmatic access to inference and most endpoints. Create keys in the Developer Dashboard. |
| Access token (JWT) | — | Short-lived user session token used by the dashboard. Create via POST /v1/users/me/access-tokens with a refresh token. |
| Refresh token | rt_ |
Long-lived token from OAuth login. Only valid for POST /v1/users/me/access-tokens. |
| Reporting token | rpt- |
Read-only access to the usage reporting endpoints. Create via POST /v1/organizations/{org_id}/reporting-tokens. |
curl https://cloud-api.near.ai/v1/chat/completions \
-H "Authorization: Bearer $NEAR_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zai-org/GLM-5.1-FP8",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Each endpoint page lists which token types it accepts under Authorizations.
Every endpoint page has an interactive playground: paste your key, edit the request, and send it directly from the browser.
The primary inference endpoint
List models, context windows, and pricing
Verify the TEE running your requests
[!NOTE]
POST /v1/responsesis stateless and supportsstore: falseonly. Read the Stateless Responses guide before migrating an integration that uses conversations, files, response history, or built-in tools.
[!NOTE]
New to NEAR AI Cloud? Start with the Quickstart, then see OpenAI Compatibility for SDK setup details.