{
  "service": "hackathon-backend",
  "status": "ok",
  "message": "Hackathon backend is running. Use the endpoints below instead of the API root.",
  "base_url": "https://aiagenthackathon2026.sh.jingle.cn/api/v1",
  "quick_start": [
    "1. POST /oauth/register from the frontend claim flow to register client_id and client_secret.",
    "2. POST /oauth/token with your client_id and client_secret to get an access token.",
    "3. Use Authorization: Bearer <access_token> for protected APIs."
  ],
  "public_endpoints": [
    {
      "method": "GET",
      "path": "/healthy",
      "description": "Health check"
    },
    {
      "method": "POST",
      "path": "/oauth/register",
      "description": "Register client credentials for frontend one-click claim"
    },
    {
      "method": "POST",
      "path": "/oauth/token",
      "description": "Exchange client credentials for an access token"
    }
  ],
  "protected_endpoints": [
    {
      "method": "POST",
      "path": "/chat/completions",
      "description": "Non-streaming chat completion",
      "timeout": "620s — server-side gRPC timeout; set your HTTP client timeout >= 620s to avoid premature disconnection"
    },
    {
      "method": "GET",
      "path": "/quota",
      "description": "Query remaining token quota"
    }
  ],
  "avatar_endpoints": [
    {
      "method": "POST",
      "path": "/personas/generate",
      "description": "Generate personas or adaptive questions. Returns 202 immediately with a jobId; poll GET /personas/job/{id} for completion.",
      "timeout": "600s — async background job timeout; the HTTP response itself is instant (202). If the job has not completed within 600s it will be marked failed.",
      "note": "Each upstream Ark LLM call within the job has a 120s timeout. Complex requests may chain multiple calls."
    },
    {
      "method": "GET",
      "path": "/personas/job/{id}",
      "description": "Poll job status. Returns 202 while pending, or the final status code + body when done. Recommended polling interval: 2-3s.",
      "timeout": "no server-side timeout on the poll itself; see /personas/generate for the 600s job deadline"
    },
    {
      "method": "GET",
      "path": "/avatars/library",
      "description": "List shared avatar library"
    },
    {
      "method": "POST",
      "path": "/avatars/by-owner",
      "description": "List avatars for one owner, body: {\"email\": \"<email>\"}"
    },
    {
      "method": "POST",
      "path": "/avatars",
      "description": "Create or update one avatar"
    },
    {
      "method": "POST",
      "path": "/avatars/batch",
      "description": "Batch create avatars"
    },
    {
      "method": "GET/DELETE",
      "path": "/avatars/{id}",
      "description": "Get or delete one avatar"
    }
  ]
}