API reference
MuskAI provides an API entrance for developers. Most OpenAI compatible clients only need to configure the Base URL and Bearer Token.
Base address
- Official website entrance: https://muskapi.cc
- Base URL: After logging in to the official website, view and copy the current recommended address on the User Center - [API Key] page.
Authentication method
Authorization: Bearer YOUR_MUSKAI_API_KEY
Content-Type: application/json
Basic request
BASE_URL="The Base URL copied from the official website User Center - [API Key] page"
curl "$BASE_URL/chat/completions" \
-H "Authorization: Bearer YOUR_MUSKAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hello"}]}'
Media APIs
- Image API: image generation, editing, and asynchronous results.
- Video generation API: JSON creation, reference media, idempotent retries, polling, and downloads.
- Video channels and monitoring: provider protocols, capability limits, and low-cost media probes for administrators.
Video generation uses asynchronous tasks. The unified interface currently does not adapt multipart uploads from the official Videos SDK. Save the task ID and returned idempotency key; query the task instead of submitting another creation request.
Troubleshooting fields
When troubleshooting, please record the request time, model name, interface path, HTTP status code, and returned error information. Don't expose the full API Key.