Skip to content

Quickstart ​

MoonNexAI public APIs authenticate requests with a Bearer API key.

http
Authorization: Bearer <MOONNEXAI_API_KEY>

Recommended API domains:

DomainWhen to use
https://moonnexai.comPrimary API domain; use this by default.

OpenAI-compatible clients usually require /v1 at the end of the Base URL, for example https://moonnexai.com/v1.

Example requests ​

cURL ​

bash
curl https://moonnexai.com/v1/models \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"

JavaScript ​

js
const response = await fetch('https://moonnexai.com/v1/models', {
  headers: {
    Authorization: 'Bearer <MOONNEXAI_API_KEY>'
  }
})

const models = await response.json()
console.log(models)

Python ​

python
import requests

response = requests.get(
    "https://moonnexai.com/v1/models",
    headers={"Authorization": "Bearer <MOONNEXAI_API_KEY>"},
    timeout=30,
)

print(response.json())

Minimal video task workflow ​

Video, digital human, music and some image APIs return asynchronous tasks. Start video generation with POST /v1/videos:

bash
curl https://moonnexai.com/v1/videos \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.0-kz-fast",
    "prompt": "A cinematic product video, slow camera push-in, clean studio light.",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'

Save the returned id or task_id, then query the task:

bash
curl https://moonnexai.com/v1/tasks/task_xxx \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"

Check status and error before reading a result URL. Continue polling queued or running tasks and stop on a terminal state.

For image-to-video and image references, provide public URLs from storage you control. Selecting a video model does not automatically create an OSS URL or a model asset ID. mode=oss is intended for integration testing and does not guarantee long-term storage or availability. Asset authentication and test uploads are free where those capabilities are available.

Next steps ​