Skip to content

Client configuration ​

Many clients supporting OpenAI-compatible API can access MoonNexAI. The core configuration is usually only three: Base URL, API Key and model name.

Generic Configuration ​

Configure ItemValue
Base URLhttps://moonnexai.com/v1
API Key<MOONNEXAI_API_KEY>
Chat Path/chat/completions
Models Path/models

If the client requests to complete a full API address, use:

text
https://moonnexai.com/v1/chat/completions

OpenAI SDK ​

JavaScript:

js
import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.MOONNEXAI_API_KEY,
  baseURL: 'https://moonnexai.com/v1'
})

const response = await client.chat.completions.create({
  model: 'gpt-5.6-terra',
  messages: [{ role: 'user', content: '写一句简短欢迎语。' }]
})

console.log(response.choices[0]?.message?.content)

Python:

python
from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["MOONNEXAI_API_KEY"],
    base_url="https://moonnexai.com/v1",
)

response = client.chat.completions.create(
    model="gpt-5.6-terra",
    messages=[{"role": "user", "content": "写一句简短欢迎语。"}],
)

print(response.choices[0].message.content)

Common client ​

Client TypeConfigure Recommendations
IDE AssistantFill in Base URL, API Key and model names.
Chat ClientSelect the OpenAI-compatible type, Base URL ends with /v1.
Workflow ToolSaves API Key in the certificate area, fills in the node parameter with the model name.
Custom applicationsCall MoonNexAI through your backend so the browser never holds the API key.

Specific courses:

Checklist ​

phenomenaCheckpoint
401API Key is correct and contains Bearer prefixes.
404Base URL Whether /v1 is overwritten or underwritten.
Models Not Availablewhether the model name is correct and whether API Key has the model permission.
Request timeoutCheck whether this is an asynchronous video or music task; query its status separately.
Streaming problemCheck that the client supports SSE and that stream: true is enabled.

See OpenAI-compatible for more compatible formats.