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 Item | Value |
|---|---|
| Base URL | https://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/completionsOpenAI 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 Type | Configure Recommendations |
|---|---|
| IDE Assistant | Fill in Base URL, API Key and model names. |
| Chat Client | Select the OpenAI-compatible type, Base URL ends with /v1. |
| Workflow Tool | Saves API Key in the certificate area, fills in the node parameter with the model name. |
| Custom applications | Call MoonNexAI through your backend so the browser never holds the API key. |
Specific courses:
Checklist
| phenomena | Checkpoint |
|---|---|
401 | API Key is correct and contains Bearer prefixes. |
404 | Base URL Whether /v1 is overwritten or underwritten. |
| Models Not Available | whether the model name is correct and whether API Key has the model permission. |
| Request timeout | Check whether this is an asynchronous video or music task; query its status separately. |
| Streaming problem | Check that the client supports SSE and that stream: true is enabled. |
See OpenAI-compatible for more compatible formats.