health.auth-check
Checks that API key, consumer, capability, and permission wiring are valid.
GET /api/v1/health/auth-check
Code-grounded integration reference for the current MaYi's MaaS public API. The page covers authentication, capability grants, request contracts, response shapes, async job polling, error formats, and the source files behind each route.
health.auth-check
Checks that API key, consumer, capability, and permission wiring are valid.
GET /api/v1/health/auth-check
file.upload
Uploads supported files to public Cloudflare R2 through the MaaS server.
POST /api/v1/files/upload
text.polish
Polishes submitted text through the configured chat provider.
POST /api/v1/text/polish
image.generate
Generates images through Doubao Ark or OpenAI image providers.
POST /api/v1/images/generate
video.generate
Creates async Seedance video generation jobs.
POST /api/v1/videos/generate
audio.transcribe
Creates async Doubao ASR transcription jobs.
POST /api/v1/audio/transcriptions
Protected route failures use a stable JSON error envelope with a trace id. The HTTP status depends on the error code; examples include 401 for missing or invalid API keys, 403 for denied permissions, 429 for quota failures, 502 for upstream provider failures, and 504 for provider timeouts.
{
"error": {
"code": "PERMISSION_DENIED",
"message": "API key does not have permission for this capability."
},
"traceId": "9f4d8f4c-7f57-4f4e-a684-7a99a8b4f2a0"
}Basic deployment health check.
None
application/json
None
{
"ok": true
}Payload and database readiness check.
None
application/json
None
{
"database": "ready",
"ok": true
}Verify protected API authentication and permission wiring.
Bearer API key plus enabled health.auth-check permission
application/json
health.auth-check
Authorization: Bearer <maas_test_or_live_key>{
"capabilityKey": "health.auth-check",
"consumerId": 12,
"ok": true,
"traceId": "9f4d8f4c-7f57-4f4e-a684-7a99a8b4f2a0"
}Upload a public integration file to R2.
Bearer API key plus enabled file.upload permission
multipart/form-data
file.upload
Authorization: Bearer <maas_test_or_live_key>curl -i http://localhost:3000/api/v1/files/upload \
-H "Authorization: Bearer <api-key>" \
-F "file=@./sample.pdf;type=application/pdf" \
-F "prefix=documents/contracts"{
"success": true,
"url": "https://cdn.example.test/maas/documents/contracts/2026-05-20T10-00-00-000Z-a1b2c3d4e5f6.pdf"
}Polish submitted text with the configured chat provider.
Bearer API key plus enabled text.polish permission
application/json
text.polish
Authorization: Bearer <maas_test_or_live_key>
Content-Type: application/json{
"text": "please make this email better",
"provider": "doubao"
}{
"success": true,
"result": {
"model": "doubao-seed-2-0-lite-260428",
"provider": "doubao",
"text": "Please improve this email."
},
"usage": {
"inputTokens": 123,
"outputTokens": 80,
"totalTokens": 203
}
}Generate one or more images.
Bearer API key plus enabled image.generate permission
application/json
image.generate
Authorization: Bearer <maas_test_or_live_key>
Content-Type: application/json{
"prompt": "a clean studio photo of a desk lamp",
"provider": "doubao",
"size": "2048x2048",
"count": 1,
"responseFormat": "url"
}{
"success": true,
"result": {
"images": [
{
"url": "https://provider.example.test/image.png"
}
],
"model": "doubao-seedream-4-5-251128",
"provider": "doubao"
},
"usage": {
"quantity": 1,
"source": "generated_image_count",
"unit": "image"
}
}Create an async video generation job.
Bearer API key plus enabled video.generate permission
application/json
video.generate
Authorization: Bearer <maas_test_or_live_key>
Content-Type: application/json
Idempotency-Key: <8-128 printable characters>{
"prompt": "A clean product video of a matte black desk lamp rotating on a white table.",
"model": "doubao-seedance-2-0-fast-260128",
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"seed": -1,
"watermark": false,
"generateAudio": true,
"imageUrls": [
"https://cdn.example.test/lamp.png"
],
"imageRole": "first_frame",
"primaryImageDetail": "high",
"returnLastFrame": true
}{
"success": true,
"job": {
"capabilityKey": "video.generate",
"createdAt": "2026-05-20T10:00:00.000Z",
"jobId": "job_video123",
"status": "submitted"
}
}Create an async audio transcription job.
Bearer API key plus enabled audio.transcribe permission
application/json
audio.transcribe
Authorization: Bearer <maas_test_or_live_key>
Content-Type: application/json
Idempotency-Key: <8-128 printable characters>{
"audioUrl": "https://cdn.example.test/audio/meeting.m4a",
"format": "m4a",
"codec": "aac",
"duration": 31.4,
"language": "zh-CN"
}{
"success": true,
"job": {
"capabilityKey": "audio.transcribe",
"createdAt": "2026-05-20T10:00:00.000Z",
"jobId": "job_audio123",
"status": "submitted"
}
}Poll an async video or audio transcription job.
Bearer API key; job must belong to the resolved consumer and caller must still have permission for the job capability
application/json
None
Authorization: Bearer <maas_test_or_live_key>{
"success": true,
"job": {
"capabilityKey": "video.generate",
"finishedAt": "2026-05-20T10:02:00.000Z",
"jobId": "job_video123",
"result": {
"providerVideoUrl": "https://provider.example.test/video.mp4",
"videoKey": "maas/video-results/job_video123.mp4",
"videoUrl": "https://cdn.example.test/maas/video-results/job_video123.mp4"
},
"status": "succeeded",
"usage": {
"quantity": 42,
"source": "provider",
"unit": "provider_unit"
}
}
}Authenticated Payload super-admin session only. Creates a new raw API key or rotates an existing credential.