Spaces:
Running
Running
File size: 1,913 Bytes
3924dcd 12f2569 3924dcd 004b298 3924dcd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | # status.py
from fastapi import APIRouter, Response
from fastapi.responses import JSONResponse
router = APIRouter(prefix="/status")
@router.head("/sfx")
async def head_sfx():
return Response(
status_code=200,
headers={
"Content-Type": "audio/mpeg",
"Accept-Ranges": "bytes",
},
)
@router.head("/image")
async def head_image():
return Response(
status_code=200,
headers={
"Content-Type": "image/jpeg",
"Accept-Ranges": "bytes",
},
)
@router.head("/video")
async def head_video():
return Response(
status_code=200,
headers={
"Content-Type": "video/mp4",
"Accept-Ranges": "bytes",
},
)
@router.head("/text")
async def head_text():
return Response(
status_code=200,
headers={
"Content-Type": "application/json",
"Accept-Ranges": "bytes",
},
)
@router.get("/")
async def get_status():
notify = "There will be scheduled maintenance on 2026-06-03 from 13:00-15:00 UTC (09:00-11:00 EDT). Some API, chat, and account services may not be available during this period."
services = {
"Video Generation": {"code": 200, "state": "ok", "message": "Running Normally"},
"Image Generation": {"code": 200, "state": "ok", "message": "Running Normally"},
"Lightning-Text v2": {"code": 200, "state": "ok", "message": "Running normally"},
"Music/SFX Generation": {"code": 200, "state": "ok", "message": "Running normally"},
}
overall_state = (
"ok" if all(s["state"] == "ok" for s in services.values()) else "degraded"
)
return JSONResponse(
status_code=200,
content={
"state": overall_state,
"services": services,
"notifications": notify,
"latest": "2.12.0",
},
) |