API Reference
MuAPI follows a simple submit-then-poll pattern. All endpoints are under https://api.muapi.ai/api/v1.
Authentication
Include your API key in every request:
x-api-key: YOUR_API_KEY
Get your API key from Dashboard → API Keys.
Request Pattern
1. Submit a Job
POST https://api.muapi.ai/api/v1/{endpoint}
x-api-key: YOUR_API_KEY
Content-Type: application/json
{ ...model-specific parameters... }
Response:
{ "request_id": "abc123xyz" }
2. Poll for Result
GET https://api.muapi.ai/api/v1/predictions/{request_id}/result
x-api-key: YOUR_API_KEY
Response (completed):
{
"status": "completed",
"outputs": ["https://cdn.muapi.ai/...output.png"]
}
Status Values
| Status | Description |
|---|---|
queued | Job is waiting to start |
pending | Job accepted, not yet running |
processing | Generation in progress |
completed | Output is ready |
failed | Generation failed |
cancelled | Job was cancelled |
Account Endpoints
# Check balance
GET /api/v1/account/balance
# Top up credits
POST /api/v1/account/topup
{ "amount": 20 }
API Key Management
# List keys
GET /api/v1/keys
# Create key
POST /api/v1/keys
{
"name": "my-app",
"is_test": true
}
Sandbox (Testing) Mode
Sandbox mode allows you to test your integration without consuming credits or performing actual background tasks.
Features
- Zero Cost: No credits are deducted from your account.
- Instant Response: Jobs are completed immediately with mock data.
- No Side Effects: Background workers are not triggered; no actual generation occurs.
How to use
- Create a key with
"is_test": truevia the API or select the Sandbox checkbox in the dashboard. - Use this key in any submit-then-poll workflow.
- The API will return successful mock responses immediately.
Behavior by Model Type
- Images: Returns the model's example/thumbnail URL.
- Videos/Audio: Returns the model's example media URL.
Delete key
DELETE /api/v1/keys/{key_id}
## File Upload
Upload media to use as inputs:
```bash
POST /api/v1/upload_file
x-api-key: YOUR_API_KEY
Content-Type: multipart/form-data
file=@image.jpg
Returns a hosted URL to pass as image_url in generation requests.
OpenAPI Spec
The full machine-readable spec is available at:
GET https://api.muapi.ai/openapi.json
Or via CLI:
muapi docs openapi
muapi docs open
See Also
- Authentication — API key setup
- Quick Start — first API call walkthrough
- Models — model catalog
- Webhooks — async result delivery