Skip to content

API keys and groups ​

MoonNexAI API Key is used to call all open API. You can create different API Keys for different projects, teams or uses, and control the available models, amounts and life periods by grouping.

Create API Key ​

  1. Login to MoonNexAI console.
  2. Enter the API Key management page.
  3. Select the use or grouping.
  4. Sets the name, the amount and the period of validity.
  5. Saves the key after creation and only uses it for service-end environment variables.

Use request for:

http
Authorization: Bearer <MOONNEXAI_API_KEY>

Grouping uses ​

sceneRecommendations
Local developmentUse of a separate API Key, which is lower and allows for rotation at any time.
Online serviceUse of independent API Key, only models for business needs.
Client itemsEach client or project uses a separate API Key to facilitate the counting and decommissioning of.
Temporary TestSets a shorter validity period and deletes it after the test.

Competence and amount ​

Clusters usually affect:

  • A callable model.
  • Single or daily amount.
  • API Key is valid.
  • And the parallel and speed limits. ​

If request returns 401, 403 or the model is not available, confirm whether API Key is valid, is in the correct grouping, and has the corresponding model privileges.

Security recommendations ​

  • Do not write API Key to frontend code, mobile end installation package or open warehouse.
  • Do not place API Key in URL query.
  • Reads environmental variables at service end, e.g. MOONNEXAI_API_KEY.
  • If the key appears in a chat record, log, screenshot or public page, it should rotate immediately.

For more details, see authentication.