{"openapi":"3.1.0","info":{"title":"ZhenRent API","description":"Agent-to-Human fulfillment and human fallback network API","version":"1.0.0"},"paths":{"/health":{"get":{"tags":["System"],"summary":"Health Check","description":"Health check endpoint for load balancers.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Health Get"}}}}}}},"/":{"get":{"tags":["System"],"summary":"Root","description":"Root endpoint.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Root  Get"}}}}}}},"/uploads/{category}/{date}/{filename}":{"get":{"tags":["System"],"summary":"Serve Upload","description":"Serve uploaded files (mock mode only).","operationId":"serve_upload_uploads__category___date___filename__get","parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string","title":"Category"}},{"name":"date","in":"path","required":true,"schema":{"type":"string","title":"Date"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/register":{"post":{"tags":["Agent - Auth"],"summary":"Register Agent","description":"Register a new agent account.\n\nCreates an agent account with email/password authentication and\nautomatically generates an API key for API access.\n\n**Process:**\n1. Validate email is not already registered\n2. Hash password securely\n3. Generate API key\n4. Create agent account\n5. Return JWT token + API key (shown only once!)\n\n**Returns:**\n- JWT access/refresh tokens for web portal\n- API key for programmatic API access\n- Account details","operationId":"register_agent_v1_agent_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/login":{"post":{"tags":["Agent - Auth"],"summary":"Login Agent","description":"Login to agent account.\n\nAuthenticates with email/password and returns JWT tokens.\nAPI key is NOT returned (use /profile to view prefix).\n\n**Returns:**\n- JWT access/refresh tokens\n- Account details (API key prefix only, not full key)","operationId":"login_agent_v1_agent_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/profile":{"get":{"tags":["Agent - Auth"],"summary":"Get Agent Profile","description":"Get current agent profile.\n\nRequires authentication via either:\n- API key (Bearer token with zr_ prefix)\n- JWT token (from login)","operationId":"get_agent_profile_v1_agent_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfileResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/me":{"get":{"tags":["Agent - Auth"],"summary":"Get Current Agent Info","description":"Get current authenticated agent information.\n\nAlias for /profile endpoint.","operationId":"get_current_agent_info_v1_agent_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfileResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/api-keys":{"get":{"tags":["Agent - Dashboard"],"summary":"List Agent Api Keys","description":"Get list of API keys for current agent.\n\nReturns prefixes only for security (never full key after creation).\nCurrently each agent has one API key. Future versions will support\nmultiple keys per agent.\n\n**Authentication Required**: Bearer token (JWT from login)\n\n**Returns**:\n- List of API keys with metadata\n- Only key prefix shown (e.g., \"zr_live_ABC...\")\n- Full key only shown once during registration","operationId":"list_agent_api_keys_v1_agent_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Response List Agent Api Keys V1 Agent Api Keys Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Agent - Dashboard"],"summary":"Create Api Key","description":"Rotate the current API key for the agent.\n\nThe current schema supports a single API key per agent, so this endpoint\nreturns a new key and overwrites the existing hash/prefix in place.","operationId":"create_api_key_v1_agent_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/stats/dashboard":{"get":{"tags":["Agent - Dashboard"],"summary":"Get Dashboard Stats","description":"Get dashboard overview statistics.\n\nProvides real-time overview of:\n- Current balance\n- Task statistics (total, completed, pending, failed)\n- Success rate\n- API usage today\n\n**Authentication Required**: Bearer token (JWT from login)\n\n**Performance**: Optimized with indexed queries, sub-100ms response time","operationId":"get_dashboard_stats_v1_agent_stats_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStatsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/transactions":{"get":{"tags":["Agent - Dashboard"],"summary":"Get Agent Transactions","description":"Get agent transaction history.\n\nReturns paginated list of all transactions including:\n- Task escrow payments\n- Recharges\n- Refunds\n\n**Authentication Required**: Bearer token (JWT from login)\n\n**Parameters**:\n- skip: Offset for pagination (default: 0)\n- limit: Number of records (default: 20, max: 100)\n- start_date: Filter from date (ISO format)\n- end_date: Filter to date (ISO format)\n\n**Returns**: Paginated transaction list ordered by most recent first","operationId":"get_agent_transactions_v1_agent_transactions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedTransactions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/stats/usage":{"get":{"tags":["Agent - Dashboard"],"summary":"Get Usage Stats","description":"Get usage statistics over time.\n\n**STATUS**: STUB IMPLEMENTATION\n\nReturns time-series data of API usage, tasks created, and spending.\nCurrently returns mock data. Full implementation requires:\n- API call tracking middleware\n- Time-series aggregation queries\n- Caching for performance\n\n**TODO**: Implement real time-series queries with date grouping","operationId":"get_usage_stats_v1_agent_stats_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","description":"Start date (ISO format)","title":"Start Date"},"description":"Start date (ISO format)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","description":"End date (ISO format)","title":"End Date"},"description":"End date (ISO format)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UsageDataPoint"},"title":"Response Get Usage Stats V1 Agent Stats Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/stats/export":{"get":{"tags":["Agent - Dashboard"],"summary":"Export Usage Data","description":"Export usage data as CSV or Excel.\n\n**STATUS**: STUB IMPLEMENTATION\n\nDownloads historical usage data in CSV or Excel format.\nCurrently returns 501 Not Implemented.\n\n**TODO**:\n- Implement CSV generation with pandas\n- Implement Excel generation with openpyxl\n- Add streaming for large datasets","operationId":"export_usage_data_v1_agent_stats_export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","description":"Start date (ISO format)","title":"Start Date"},"description":"Start date (ISO format)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","description":"End date (ISO format)","title":"End Date"},"description":"End date (ISO format)"},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|excel)$","default":"csv","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/api-keys/{key_id}":{"delete":{"tags":["Agent - Dashboard"],"summary":"Delete Api Key","description":"Disable the current API key.","operationId":"delete_api_key_v1_agent_api_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Agent - Dashboard"],"summary":"Update Api Key","description":"Update API key status (enable/disable).","operationId":"update_api_key_v1_agent_api_keys__key_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/create":{"post":{"tags":["Agent - Tasks"],"summary":"Create Task","description":"Create a new task (Agent API).\n\n- Validates agent balance\n- Creates escrow account\n- Returns task ID and cost breakdown","operationId":"create_task_v1_tasks_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/tasks/{task_id}":{"get":{"tags":["Agent - Tasks"],"summary":"Get Task Status","description":"Get detailed task status and progress.","operationId":"get_task_status_v1_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/result":{"get":{"tags":["Agent - Tasks"],"summary":"Get Task Result","description":"Get task result (only available after completion).","operationId":"get_task_result_v1_tasks__task_id__result_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResultResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks":{"get":{"tags":["Agent - Tasks"],"summary":"List Tasks","description":"List agent's tasks with pagination.","operationId":"list_tasks_v1_tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Starting After"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/cancel":{"post":{"tags":["Agent - Tasks"],"summary":"Cancel Task","description":"Cancel a pending or assigned task.","operationId":"cancel_task_v1_tasks__task_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Task V1 Tasks  Task Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/feedback":{"post":{"tags":["Agent - Tasks"],"summary":"Submit Feedback","description":"Submit quality feedback on completed task.","operationId":"submit_feedback_v1_tasks__task_id__feedback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskFeedback"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Submit Feedback V1 Tasks  Task Id  Feedback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/send-sms":{"post":{"tags":["Worker"],"summary":"Send Sms Code","description":"Send SMS verification code to phone number.\n\nArgs:\n    phone_number: Chinese mobile phone number (11 digits)\n    purpose: Purpose of verification (register, login, reset_password)\n\nReturns:\n    Success message or error","operationId":"send_sms_code_v1_worker_send_sms_post","parameters":[{"name":"phone_number","in":"query","required":true,"schema":{"type":"string","title":"Phone Number"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string","default":"register","title":"Purpose"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Sms Code V1 Worker Send Sms Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/verify-sms":{"post":{"tags":["Worker"],"summary":"Verify Sms Code","description":"Verify SMS code (for testing purposes).\n\nArgs:\n    phone_number: Phone number\n    code: Verification code\n    purpose: Purpose of verification\n\nReturns:\n    Verification result","operationId":"verify_sms_code_v1_worker_verify_sms_post","parameters":[{"name":"phone_number","in":"query","required":true,"schema":{"type":"string","title":"Phone Number"}},{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string","default":"register","title":"Purpose"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Sms Code V1 Worker Verify Sms Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/reset-password":{"post":{"tags":["Worker"],"summary":"Reset Password","description":"Reset worker password with SMS verification.\n\nArgs:\n    phone_number: Worker's phone number\n    code: SMS verification code\n    new_password: New password (min 8 characters)\n\nReturns:\n    Success message","operationId":"reset_password_v1_worker_reset_password_post","parameters":[{"name":"phone_number","in":"query","required":true,"schema":{"type":"string","title":"Phone Number"}},{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"new_password","in":"query","required":true,"schema":{"type":"string","title":"New Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset Password V1 Worker Reset Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/register":{"post":{"tags":["Worker"],"summary":"Register Worker","description":"Register a new worker account.\n\nFor MVP: simplified registration (no SMS verification).\nProduction: integrate Alibaba Cloud SMS service.","operationId":"register_worker_v1_worker_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerRegister"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/login":{"post":{"tags":["Worker"],"summary":"Login Worker","description":"Worker login with phone and password.","operationId":"login_worker_v1_worker_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/profile":{"get":{"tags":["Worker"],"summary":"Get Worker Profile","description":"Get current worker's profile.","operationId":"get_worker_profile_v1_worker_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/worker/tasks/available":{"get":{"tags":["Worker"],"summary":"Get Available Tasks","description":"Get available tasks matching worker's location and skills.\n\nIncludes distance calculation and coordinate extraction for location-based tasks.","operationId":"get_available_tasks_v1_worker_tasks_available_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"latitude","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":90,"minimum":-90},{"type":"null"}],"title":"Latitude"}},{"name":"longitude","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":180,"minimum":-180},{"type":"null"}],"title":"Longitude"}},{"name":"max_distance_km","in":"query","required":false,"schema":{"type":"number","maximum":50,"exclusiveMinimum":0,"default":5,"title":"Max Distance Km"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","pattern":"^(payment_desc|distance_asc|deadline_asc)$","default":"payment_desc","title":"Sort By"}},{"name":"min_payment_cents","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"title":"Min Payment Cents"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableTasksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/tasks/{task_id}/accept":{"post":{"tags":["Worker"],"summary":"Accept Task","description":"Accept a task assignment.","operationId":"accept_task_v1_worker_tasks__task_id__accept_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskAcceptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/tasks/my-tasks":{"get":{"tags":["Worker"],"summary":"Get My Tasks","description":"Get worker's assigned tasks.\n\nReturns all tasks that the worker has accepted, including their current status.","operationId":"get_my_tasks_v1_worker_tasks_my_tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(accepted|in_progress|submitted|completed|failed)$"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/assignments/{assignment_id}/submit":{"post":{"tags":["Worker"],"summary":"Submit Task Result","description":"Submit task result.","operationId":"submit_task_result_v1_worker_assignments__assignment_id__submit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSubmissionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSubmissionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/earnings":{"get":{"tags":["Worker"],"summary":"Get Worker Earnings","description":"Get worker's earnings summary.","operationId":"get_worker_earnings_v1_worker_earnings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerEarnings"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/worker/assignments/{assignment_id}/submit-with-photo":{"post":{"tags":["Worker"],"summary":"Submit Task With Photo","description":"Submit task result with photo and GPS verification.\n\nThis endpoint validates that the uploaded photo was taken at the task location\nby extracting GPS coordinates from EXIF data.\n\n**Anti-fraud measure**: Photo must be taken within 100m of task location.\n\n**Requirements**:\n- Photo must have GPS EXIF data\n- GPS location must be within 100m of task location\n- Photo file size < 10MB\n\n**Example (using curl)**:\n```bash\ncurl -X POST \"http://localhost:8000/v1/worker/assignments/{id}/submit-with-photo\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -F \"photo=@photo_with_gps.jpg\" \\\n  -F 'result_data={\"notes\": \"Task completed successfully\"}'\n```\n\nArgs:\n    assignment_id: Task assignment ID\n    photo: Uploaded photo file with GPS EXIF\n    result_data: JSON string of task result\n    worker: Current authenticated worker\n    db: Database session\n\nReturns:\n    Task submission response\n\nRaises:\n    HTTPException 400: If GPS validation fails or photo is invalid\n    HTTPException 404: If assignment not found","operationId":"submit_task_with_photo_v1_worker_assignments__assignment_id__submit_with_photo_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_submit_task_with_photo_v1_worker_assignments__assignment_id__submit_with_photo_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSubmissionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/worker/tasks/{task_id}/rate":{"post":{"tags":["Worker"],"summary":"Rate Agent And Task","description":"Worker评价Agent和任务质量.\n\nWorker完成任务后可以评价Agent的服务质量和任务的合理性。\n\nArgs:\n    task_id: 任务ID\n    rating_data: 评分数据（0-5星）\n    worker: 当前认证的Worker\n    db: 数据库会话\n\nReturns:\n    评分确认响应\n\nRaises:\n    HTTPException 404: 任务未找到\n    HTTPException 403: Worker无权评价此任务（未完成或未接受）\n    HTTPException 409: 已经评价过此任务","operationId":"rate_agent_and_task_v1_worker_tasks__task_id__rate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerRatingCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerRatingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ws/stats":{"get":{"tags":["WebSocket"],"summary":"Get Websocket Stats","description":"Get WebSocket connection statistics.\n\nReturns:\n    Connection statistics including counts and active connections","operationId":"get_websocket_stats_v1_ws_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/payment/recharge":{"post":{"tags":["Payment"],"summary":"Create Recharge","description":"Create a recharge order for the agent.\n\nThe agent will be redirected to Alipay payment page.\n\n**Process**:\n1. Create Alipay payment order\n2. Return payment URL\n3. Agent completes payment on Alipay\n4. Alipay sends callback to our server\n5. Balance updated automatically\n\n**Minimum amount**: 1 RMB (100 cents)\n\n**Example**:\n```bash\ncurl -X POST \"http://localhost:8000/v1/payment/recharge\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"amount_cents\": 10000}'\n```","operationId":"create_recharge_v1_payment_recharge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RechargeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RechargeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/payment/alipay/callback":{"post":{"tags":["Payment"],"summary":"Alipay Callback","description":"Alipay payment notification callback.\n\nThis endpoint is called by Alipay after payment completion.\nIt verifies the payment and updates the agent's balance.\n\n**Note**: This endpoint is called by Alipay servers, not by clients.\n\n**Response**: Must return \"success\" string for Alipay.","operationId":"alipay_callback_v1_payment_alipay_callback_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/payment/withdraw":{"post":{"tags":["Payment"],"summary":"Create Withdrawal","description":"Create a withdrawal request for the worker.\n\nWorker's earnings are transferred to their Alipay account.\n\n**Process**:\n1. Check worker balance\n2. Create withdrawal request\n3. Admin reviews (if required)\n4. Transfer to Alipay account\n5. Update balance\n\n**Minimum amount**: 10 RMB (1000 cents)\n\n**Example**:\n```bash\ncurl -X POST \"http://localhost:8000/v1/payment/withdraw\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount_cents\": 50000,\n    \"alipay_account\": \"worker@example.com\"\n  }'\n```","operationId":"create_withdrawal_v1_payment_withdraw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/payment/balance":{"get":{"tags":["Payment V2","Payment V2"],"summary":"Get Balance","description":"Get current agent account balance.\n\n**Returns**:\n- Balance in cents and RMB\n\n**Example**:\n```bash\ncurl -X GET \"http://localhost:8000/v1/payment/balance\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\"\n```","operationId":"get_balance_v1_payment_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/worker/balance":{"get":{"tags":["Payment"],"summary":"Get Worker Balance","description":"Get current worker balance.\n\nReturns:\n    Balance information in cents","operationId":"get_worker_balance_v1_worker_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/upload/task-proof":{"post":{"tags":["Upload"],"summary":"Upload Task Proof","description":"Upload single task completion proof file.\n\nSupports: images (JPG, PNG), documents (PDF), videos (MP4, MOV)\nMax size: 10MB per file","operationId":"upload_task_proof_v1_upload_task_proof_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_task_proof_v1_upload_task_proof_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Upload Task Proof V1 Upload Task Proof Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/upload/task-proofs-multiple":{"post":{"tags":["Upload"],"summary":"Upload Multiple Proofs","description":"Upload multiple task proof files at once.\n\nMax files: 5 per request\nMax size: 10MB per file","operationId":"upload_multiple_proofs_v1_upload_task_proofs_multiple_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_multiple_proofs_v1_upload_task_proofs_multiple_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Upload Multiple Proofs V1 Upload Task Proofs Multiple Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/payment/providers":{"get":{"tags":["Payment V2","Payment V2"],"summary":"Get Available Providers","description":"Get list of available payment providers.\n\nReturns:\n    List of configured payment methods\n\n**Example Response**:\n```json\n{\n    \"providers\": [\"alipay\", \"wechat\"],\n    \"default\": \"alipay\"\n}\n```","operationId":"get_available_providers_v1_payment_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/payment/create":{"post":{"tags":["Payment V2","Payment V2"],"summary":"Create Payment","description":"Create a payment order for account recharge.\n\nSupports both Alipay and WeChat Pay.\n\n**Payment Methods**:\n- `alipay`: Alipay payment\n- `wechat`: WeChat Pay\n\n**Payment Types**:\n- Alipay:\n  - `page`: PC website payment\n  - `wap`: Mobile website payment\n  - `qr`: QR code payment\n- WeChat Pay:\n  - `native`: QR code payment\n  - `jsapi`: JSAPI/Mini Program payment (requires openid)\n  - `h5`: Mobile website payment (requires client_ip)\n\n**Process**:\n1. Create payment order with provider\n2. Return payment URL or QR code\n3. User completes payment\n4. Provider sends webhook notification\n5. Balance updated automatically\n\n**Example (Alipay)**:\n```bash\ncurl -X POST \"http://localhost:8000/v1/payment/create\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount_cents\": 10000,\n    \"payment_method\": \"alipay\",\n    \"payment_type\": \"page\"\n  }'\n```\n\n**Example (WeChat Pay QR Code)**:\n```bash\ncurl -X POST \"http://localhost:8000/v1/payment/create\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount_cents\": 10000,\n    \"payment_method\": \"wechat\",\n    \"payment_type\": \"native\"\n  }'\n```","operationId":"create_payment_v1_payment_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/payment/query/{order_id}":{"get":{"tags":["Payment V2","Payment V2"],"summary":"Query Payment","description":"Query payment order status.\n\n**Parameters**:\n- `order_id`: Order ID to query\n- `payment_method`: Payment method (alipay or wechat)\n\n**Returns**:\n- Payment status and details\n\n**Example**:\n```bash\ncurl -X GET \"http://localhost:8000/v1/payment/query/RECHARGE20240401123456?payment_method=alipay\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\"\n```","operationId":"query_payment_v1_payment_query__order_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"payment_method","in":"query","required":true,"schema":{"$ref":"#/components/schemas/PaymentMethodEnum","description":"Payment method"},"description":"Payment method"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/payment/refund":{"post":{"tags":["Payment V2","Payment V2"],"summary":"Create Refund","description":"Create a refund for a completed payment.\n\n**Requirements**:\n- Original payment must be completed\n- Refund amount must not exceed original payment\n- Refund reason must be provided\n\n**Process**:\n1. Verify original payment exists and is completed\n2. Create refund with payment provider\n3. Update agent balance\n4. Create refund transaction record\n\n**Example**:\n```bash\ncurl -X POST \"http://localhost:8000/v1/payment/refund\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"order_id\": \"RECHARGE20240401123456\",\n    \"refund_amount_cents\": 5000,\n    \"refund_reason\": \"用户申请退款\",\n    \"payment_method\": \"alipay\"\n  }'\n```","operationId":"create_refund_v1_payment_refund_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/payment/health":{"get":{"tags":["Payment V2","Payment V2"],"summary":"Get Payment Health","description":"Get payment service health status.\n\nReturns status of all configured payment providers.\n\n**Returns**:\n- Overall service status\n- Individual provider status\n- List of available providers\n\n**Example**:\n```bash\ncurl -X GET \"https://www.zhenrent.com/v1/payment/health\"\n```\n\n**Example Response**:\n```json\n{\n    \"status\": \"degraded\",\n    \"providers\": {\n        \"alipay\": {\n            \"status\": \"unavailable\",\n            \"error\": \"Invalid RSA key format\"\n        },\n        \"wechat\": {\n            \"status\": \"available\"\n        }\n    },\n    \"available_providers\": [\"wechat\"],\n    \"total_providers\": 2,\n    \"available_count\": 1\n}\n```","operationId":"get_payment_health_v1_payment_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/agent/payments/recharge":{"post":{"tags":["Payment V2","Payment V2"],"summary":"Recharge Agent Balance","description":"Recharge agent account balance (compatibility endpoint).\n\nThis endpoint provides a simplified interface for account recharge,\ncompatible with MCP server and legacy clients.\n\n**Supported Payment Methods**:\n- `wechat`: WeChat Pay (QR code)\n- `alipay`: Alipay (page payment)\n\n**Example (WeChat Pay)**:\n```bash\ncurl -X POST \"https://www.zhenrent.com/v1/agent/payments/recharge\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount_cents\": 10000,\n    \"payment_method\": \"wechat\"\n  }'\n```\n\n**Example (Alipay)**:\n```bash\ncurl -X POST \"https://www.zhenrent.com/v1/agent/payments/recharge\" \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount_cents\": 10000,\n    \"payment_method\": \"alipay\"\n  }'\n```\n\n**Response**:\n```json\n{\n  \"order_id\": \"RECHARGE20260403123456\",\n  \"qr_code_url\": \"weixin://wxpay/bizpayurl?pr=xyz\",\n  \"amount_cents\": 10000,\n  \"status\": \"pending\"\n}\n```","operationId":"recharge_agent_balance_v1_agent_payments_recharge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/webhooks/alipay":{"post":{"tags":["Payment Webhooks","Payment Webhooks"],"summary":"Alipay Webhook","description":"Alipay payment notification callback.\n\nThis endpoint is called by Alipay servers after payment completion.\nIt verifies the signature and updates the payment status.\n\n**Important**:\n- This endpoint is called by Alipay, not by clients\n- Must return \"success\" string if processing succeeds\n- Must return \"failure\" string if processing fails\n- Alipay will retry if not \"success\" is returned\n\n**Security**:\n- RSA2 signature verification is performed\n- Only HTTPS allowed in production\n- Idempotency handled (duplicate callbacks ignored)\n\n**Response Format**:\n- Success: \"success\" (plain text)\n- Failure: \"failure\" (plain text)","operationId":"alipay_webhook_api_webhooks_alipay_post","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/api/webhooks/wechat":{"post":{"tags":["Payment Webhooks","Payment Webhooks"],"summary":"Wechat Webhook","description":"WeChat Pay payment notification callback.\n\nThis endpoint is called by WeChat Pay servers after payment completion.\nIt verifies the APIv3 signature and updates the payment status.\n\n**Important**:\n- This endpoint is called by WeChat Pay, not by clients\n- Must return specific JSON format\n- WeChat Pay will retry if error code is returned\n\n**Security**:\n- APIv3 signature verification (SHA256 with RSA)\n- AES-256-GCM decryption of encrypted data\n- Only HTTPS allowed in production\n- Idempotency handled\n\n**Response Format**:\n- Success: {\"code\": \"SUCCESS\", \"message\": \"成功\"}\n- Failure: {\"code\": \"FAIL\", \"message\": \"失败原因\"}","operationId":"wechat_webhook_api_webhooks_wechat_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/alipay":{"post":{"tags":["Payment Webhooks Compatibility","Payment Webhooks"],"summary":"Alipay Webhook","description":"Alipay payment notification callback.\n\nThis endpoint is called by Alipay servers after payment completion.\nIt verifies the signature and updates the payment status.\n\n**Important**:\n- This endpoint is called by Alipay, not by clients\n- Must return \"success\" string if processing succeeds\n- Must return \"failure\" string if processing fails\n- Alipay will retry if not \"success\" is returned\n\n**Security**:\n- RSA2 signature verification is performed\n- Only HTTPS allowed in production\n- Idempotency handled (duplicate callbacks ignored)\n\n**Response Format**:\n- Success: \"success\" (plain text)\n- Failure: \"failure\" (plain text)","operationId":"alipay_webhook_webhooks_alipay_post","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/webhooks/wechat":{"post":{"tags":["Payment Webhooks Compatibility","Payment Webhooks"],"summary":"Wechat Webhook","description":"WeChat Pay payment notification callback.\n\nThis endpoint is called by WeChat Pay servers after payment completion.\nIt verifies the APIv3 signature and updates the payment status.\n\n**Important**:\n- This endpoint is called by WeChat Pay, not by clients\n- Must return specific JSON format\n- WeChat Pay will retry if error code is returned\n\n**Security**:\n- APIv3 signature verification (SHA256 with RSA)\n- AES-256-GCM decryption of encrypted data\n- Only HTTPS allowed in production\n- Idempotency handled\n\n**Response Format**:\n- Success: {\"code\": \"SUCCESS\", \"message\": \"成功\"}\n- Failure: {\"code\": \"FAIL\", \"message\": \"失败原因\"}","operationId":"wechat_webhook_webhooks_wechat_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentAuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"email":{"type":"string","title":"Email"},"organization_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Name"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"api_key_prefix":{"type":"string","title":"Api Key Prefix"},"balance_cents":{"type":"integer","title":"Balance Cents"}},"type":"object","required":["access_token","refresh_token","agent_id","email","organization_name","api_key_prefix","balance_cents"],"title":"AgentAuthResponse","description":"Agent authentication response."},"AgentLoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"AgentLoginRequest","description":"Agent login request."},"AgentProfileResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"email":{"type":"string","title":"Email"},"organization_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Name"},"balance_cents":{"type":"integer","title":"Balance Cents"},"balance_rmb":{"type":"number","title":"Balance Rmb"},"api_key_prefix":{"type":"string","title":"Api Key Prefix"},"rate_limit_per_minute":{"type":"integer","title":"Rate Limit Per Minute"},"max_concurrent_tasks":{"type":"integer","title":"Max Concurrent Tasks"},"account_status":{"type":"string","title":"Account Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["agent_id","email","organization_name","balance_cents","balance_rmb","api_key_prefix","rate_limit_per_minute","max_concurrent_tasks","account_status","created_at","last_used_at"],"title":"AgentProfileResponse","description":"Agent profile response."},"AgentRegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":6,"title":"Password"},"organization_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Name"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"}},"type":"object","required":["email","password"],"title":"AgentRegisterRequest","description":"Agent registration request."},"ApiKeyResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"prefix":{"type":"string","title":"Prefix"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"rate_limit_per_minute":{"type":"integer","title":"Rate Limit Per Minute"},"is_active":{"type":"boolean","title":"Is Active"},"usage_count":{"type":"integer","title":"Usage Count","default":0},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"}},"type":"object","required":["id","prefix","name","created_at","last_used_at","rate_limit_per_minute","is_active"],"title":"ApiKeyResponse","description":"API key information (prefix only for security)."},"AvailableTaskItem":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"payment_cents":{"type":"integer","title":"Payment Cents"},"distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Distance Meters"},"deadline_at":{"type":"string","format":"date-time","title":"Deadline At"},"estimated_duration_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimated Duration Minutes"},"required_skills":{"items":{"type":"string"},"type":"array","title":"Required Skills"},"location":{"anyOf":[{"$ref":"#/components/schemas/LocationResponse"},{"type":"null"}]}},"type":"object","required":["task_id","title","description","payment_cents","deadline_at","required_skills"],"title":"AvailableTaskItem","description":"Task item in available tasks list."},"AvailableTasksResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/AvailableTaskItem"},"type":"array","title":"Tasks"},"metadata":{"additionalProperties":{"type":"integer"},"type":"object","title":"Metadata"}},"type":"object","required":["tasks"],"title":"AvailableTasksResponse","description":"Response for available tasks query."},"Body_submit_task_with_photo_v1_worker_assignments__assignment_id__submit_with_photo_post":{"properties":{"photo":{"type":"string","format":"binary","title":"Photo","description":"Photo with GPS EXIF data"},"result_data":{"type":"string","title":"Result Data","description":"JSON string of result data"}},"type":"object","required":["photo","result_data"],"title":"Body_submit_task_with_photo_v1_worker_assignments__assignment_id__submit_with_photo_post"},"Body_upload_multiple_proofs_v1_upload_task_proofs_multiple_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_upload_multiple_proofs_v1_upload_task_proofs_multiple_post"},"Body_upload_task_proof_v1_upload_task_proof_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_task_proof_v1_upload_task_proof_post"},"CostBreakdown":{"properties":{"worker_payout_cents":{"type":"integer","title":"Worker Payout Cents"},"platform_fee_cents":{"type":"integer","title":"Platform Fee Cents"},"total_cents":{"type":"integer","title":"Total Cents"}},"type":"object","required":["worker_payout_cents","platform_fee_cents","total_cents"],"title":"CostBreakdown","description":"Cost breakdown for task."},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","default":"Primary API Key"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"}},"type":"object","title":"CreateApiKeyRequest","description":"Create or rotate a single API key."},"CreateApiKeyResponse":{"properties":{"api_key":{"type":"string","title":"Api Key"},"prefix":{"type":"string","title":"Prefix"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["api_key","prefix","name","created_at"],"title":"CreateApiKeyResponse","description":"Full API key payload returned only once on creation."},"CreatePaymentRequest":{"properties":{"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Payment amount in cents"},"payment_method":{"$ref":"#/components/schemas/PaymentMethodEnum","description":"Payment method"},"payment_type":{"anyOf":[{"$ref":"#/components/schemas/PaymentTypeEnum"},{"type":"null"}],"description":"Payment type (platform-specific, auto-selected if not provided)"},"openid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Openid","description":"WeChat OpenID (required for JSAPI payment)"},"client_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Ip","description":"Client IP address (required for WeChat H5 payment)"}},"type":"object","required":["amount_cents","payment_method"],"title":"CreatePaymentRequest","description":"Create payment order request.","example":{"amount_cents":10000,"payment_method":"alipay","payment_type":"page"}},"DashboardStatsResponse":{"properties":{"balance_cents":{"type":"integer","title":"Balance Cents"},"balance_rmb":{"type":"number","title":"Balance Rmb"},"tasks_total":{"type":"integer","title":"Tasks Total"},"tasks_completed":{"type":"integer","title":"Tasks Completed"},"tasks_pending":{"type":"integer","title":"Tasks Pending"},"tasks_failed":{"type":"integer","title":"Tasks Failed"},"success_rate":{"type":"number","title":"Success Rate"},"api_calls_today":{"type":"integer","title":"Api Calls Today"},"organization_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Name"}},"type":"object","required":["balance_cents","balance_rmb","tasks_total","tasks_completed","tasks_pending","tasks_failed","success_rate","api_calls_today","organization_name"],"title":"DashboardStatsResponse","description":"Dashboard overview statistics."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LocationCreate":{"properties":{"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude","description":"Latitude in decimal degrees"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude","description":"Longitude in decimal degrees"},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address","description":"Human-readable address"},"max_distance_meters":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Distance Meters","description":"Maximum distance from target location (meters)","default":5000}},"type":"object","required":["latitude","longitude"],"title":"LocationCreate","description":"Geographic location for task creation.","example":{"address":"北京市朝阳区建国路1号","latitude":39.9042,"longitude":116.4074,"max_distance_meters":500}},"LocationResponse":{"properties":{"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"}},"type":"object","required":["latitude","longitude"],"title":"LocationResponse","description":"Geographic location in responses."},"PaginatedTransactions":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TransactionResponse"},"type":"array","title":"Data"},"total":{"type":"integer","title":"Total"},"skip":{"type":"integer","title":"Skip"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["data","total","skip","limit"],"title":"PaginatedTransactions","description":"Paginated transaction list."},"PaymentMethodEnum":{"type":"string","enum":["alipay","wechat"],"title":"PaymentMethodEnum","description":"Payment method enum for API."},"PaymentOrderResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"payment_method":{"type":"string","title":"Payment Method"},"payment_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Url"},"qr_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Code"},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data"},"message":{"type":"string","title":"Message"}},"type":"object","required":["order_id","amount_cents","payment_method","message"],"title":"PaymentOrderResponse","description":"Payment order response."},"PaymentStatusResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"status":{"type":"string","title":"Status"},"success":{"type":"boolean","title":"Success"},"amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Cents"},"external_transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Transaction Id"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At"},"db_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Db Status"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["order_id","status","success"],"title":"PaymentStatusResponse","description":"Payment status query response."},"PaymentTypeEnum":{"type":"string","enum":["page","wap","qr","native","jsapi","h5"],"title":"PaymentTypeEnum","description":"Payment type enum for API."},"PhotoInfo":{"properties":{"url":{"type":"string","title":"Url"},"taken_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Taken At"},"location":{"anyOf":[{"$ref":"#/components/schemas/LocationResponse"},{"type":"null"}]}},"type":"object","required":["url"],"title":"PhotoInfo","description":"Photo information in task result."},"RechargeRequest":{"properties":{"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Recharge amount in cents (e.g., 10000 = 100 RMB)"}},"type":"object","required":["amount_cents"],"title":"RechargeRequest","description":"Agent recharge request","example":{"amount_cents":10000}},"RechargeResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"payment_url":{"type":"string","title":"Payment Url"},"amount_cents":{"type":"integer","title":"Amount Cents"},"message":{"type":"string","title":"Message"}},"type":"object","required":["order_id","payment_url","amount_cents","message"],"title":"RechargeResponse","description":"Recharge response with payment URL"},"RefundRequest":{"properties":{"order_id":{"type":"string","title":"Order Id","description":"Original order ID"},"refund_amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Refund Amount Cents","description":"Refund amount in cents"},"refund_reason":{"type":"string","maxLength":200,"minLength":1,"title":"Refund Reason","description":"Refund reason"},"payment_method":{"$ref":"#/components/schemas/PaymentMethodEnum","description":"Payment method"}},"type":"object","required":["order_id","refund_amount_cents","refund_reason","payment_method"],"title":"RefundRequest","description":"Refund request.","example":{"order_id":"RECHARGE20240401123456","payment_method":"alipay","refund_amount_cents":5000,"refund_reason":"用户申请退款"}},"RefundResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"refund_id":{"type":"string","title":"Refund Id"},"order_id":{"type":"string","title":"Order Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","refund_id","order_id","amount_cents","status","message"],"title":"RefundResponse","description":"Refund response."},"TaskAcceptResponse":{"properties":{"assignment_id":{"type":"string","format":"uuid","title":"Assignment Id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"task_details":{"additionalProperties":true,"type":"object","title":"Task Details"}},"type":"object","required":["assignment_id","expires_at","task_details"],"title":"TaskAcceptResponse","description":"Response after accepting a task."},"TaskCreate":{"properties":{"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title","description":"Task title"},"description":{"type":"string","minLength":1,"title":"Description","description":"Detailed task description"},"task_type":{"type":"string","pattern":"^(physical_verification|data_collection|survey|delivery|other)$","title":"Task Type","description":"Type of task"},"location":{"anyOf":[{"$ref":"#/components/schemas/LocationCreate"},{"type":"null"}],"description":"Target location (required for physical tasks)"},"requirements":{"additionalProperties":true,"type":"object","title":"Requirements","description":"Task-specific requirements (skills, certifications, etc.)"},"deadline_at":{"type":"string","format":"date-time","title":"Deadline At","description":"Task deadline (ISO 8601 UTC)"},"budget_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Budget Cents","description":"Task budget in cents (CNY)"},"max_workers":{"type":"integer","maximum":10.0,"exclusiveMinimum":0.0,"title":"Max Workers","description":"Maximum workers to assign","default":1},"webhook_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Webhook Url","description":"Webhook callback URL"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Idempotency Key","description":"Unique key to prevent duplicate task creation"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Custom metadata"}},"type":"object","required":["title","description","task_type","deadline_at","budget_cents"],"title":"TaskCreate","description":"Schema for creating a new task (Agent API).","example":{"budget_cents":1500,"deadline_at":"2026-04-15T18:00:00Z","description":"Take photo of business hours sign at this address","idempotency_key":"task_20260330_001","location":{"address":"北京市朝阳区建国路1号","latitude":39.9042,"longitude":116.4074,"max_distance_meters":500},"max_workers":1,"requirements":{"photo_requirements":{"min_count":2,"must_include_timestamp":true},"skills":["photography"]},"task_type":"physical_verification","title":"Verify storefront hours"}},"TaskFeedback":{"properties":{"rating":{"type":"number","maximum":5.0,"minimum":0.0,"title":"Rating","description":"Rating (0-5 stars)"},"quality_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Quality Score","description":"Quality score (0-1)"},"feedback_text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Feedback Text"},"accept_result":{"type":"boolean","title":"Accept Result","description":"Whether to accept the result"}},"type":"object","required":["rating","quality_score","accept_result"],"title":"TaskFeedback","description":"Agent feedback on completed task.","example":{"accept_result":true,"feedback_text":"Photos were clear and helpful","quality_score":0.9,"rating":5.0}},"TaskListItem":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"task_type":{"type":"string","title":"Task Type"},"status":{"type":"string","title":"Status"},"budget_cents":{"type":"integer","title":"Budget Cents"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deadline_at":{"type":"string","format":"date-time","title":"Deadline At"}},"type":"object","required":["task_id","title","description","task_type","status","budget_cents","created_at","updated_at","deadline_at"],"title":"TaskListItem","description":"Task item in list response."},"TaskListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TaskListItem"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","has_more"],"title":"TaskListResponse","description":"List of tasks with pagination."},"TaskProgress":{"properties":{"assigned_workers":{"type":"integer","title":"Assigned Workers"},"completed_workers":{"type":"integer","title":"Completed Workers"},"estimated_completion_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Estimated Completion At"}},"type":"object","required":["assigned_workers","completed_workers"],"title":"TaskProgress","description":"Task progress information."},"TaskResponse":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"status":{"type":"string","title":"Status"},"estimated_completion_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Estimated Completion At"},"cost_breakdown":{"$ref":"#/components/schemas/CostBreakdown"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["task_id","status","cost_breakdown","created_at"],"title":"TaskResponse","description":"Response after creating a task."},"TaskResultData":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Structured result data"},"photos":{"items":{"$ref":"#/components/schemas/PhotoInfo"},"type":"array","title":"Photos"},"worker_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Notes"}},"type":"object","required":["data"],"title":"TaskResultData","description":"Task result data from worker."},"TaskResultResponse":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"$ref":"#/components/schemas/TaskResultData"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"}},"type":"object","required":["task_id","status"],"title":"TaskResultResponse","description":"Task result response."},"TaskStatusResponse":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"status":{"type":"string","title":"Status"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"task_type":{"type":"string","title":"Task Type"},"budget_cents":{"type":"integer","title":"Budget Cents"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"progress":{"$ref":"#/components/schemas/TaskProgress"},"assignments":{"items":{"$ref":"#/components/schemas/WorkerInfo"},"type":"array","title":"Assignments"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deadline_at":{"type":"string","format":"date-time","title":"Deadline At"}},"type":"object","required":["task_id","status","title","description","task_type","budget_cents","progress","assignments","created_at","updated_at","deadline_at"],"title":"TaskStatusResponse","description":"Detailed task status response."},"TaskSubmissionRequest":{"properties":{"result_data":{"additionalProperties":true,"type":"object","title":"Result Data","description":"Structured task result"},"worker_notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Worker Notes"},"location_latitude":{"anyOf":[{"type":"number","maximum":90.0,"minimum":-90.0},{"type":"null"}],"title":"Location Latitude"},"location_longitude":{"anyOf":[{"type":"number","maximum":180.0,"minimum":-180.0},{"type":"null"}],"title":"Location Longitude"},"proof_urls":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Proof Urls","description":"List of uploaded proof file URLs"}},"type":"object","required":["result_data"],"title":"TaskSubmissionRequest","description":"Worker task submission.","example":{"location_latitude":39.9045,"location_longitude":116.407,"proof_urls":["http://localhost:4001/uploads/task-proofs/20260331/abc123.jpg","http://localhost:4001/uploads/task-proofs/20260331/def456.jpg"],"result_data":{"business_hours":"Mon-Fri 9:00-18:00","store_status":"open"},"worker_notes":"Sign is clearly visible"}},"TaskSubmissionResponse":{"properties":{"submission_id":{"type":"string","format":"uuid","title":"Submission Id"},"status":{"type":"string","title":"Status"},"estimated_approval_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Estimated Approval At"}},"type":"object","required":["submission_id","status"],"title":"TaskSubmissionResponse","description":"Response after task submission."},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In","description":"Access token expiration in seconds"}},"type":"object","required":["access_token","refresh_token","expires_in"],"title":"Token","description":"JWT token response."},"TransactionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"transaction_type":{"type":"string","title":"Transaction Type"},"amount_cents":{"type":"integer","title":"Amount Cents"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"task_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Task Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","transaction_type","amount_cents","status","created_at","completed_at","task_id","description"],"title":"TransactionResponse","description":"Transaction history item."},"UpdateApiKeyRequest":{"properties":{"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["is_active"],"title":"UpdateApiKeyRequest","description":"Enable or disable the agent API key."},"UsageDataPoint":{"properties":{"date":{"type":"string","title":"Date"},"api_calls":{"type":"integer","title":"Api Calls"},"tasks_created":{"type":"integer","title":"Tasks Created"},"amount_spent_cents":{"type":"integer","title":"Amount Spent Cents"}},"type":"object","required":["date","api_calls","tasks_created","amount_spent_cents"],"title":"UsageDataPoint","description":"Usage statistics data point."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WithdrawalRequest":{"properties":{"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents","description":"Withdrawal amount in cents"},"alipay_account":{"type":"string","minLength":1,"title":"Alipay Account","description":"Alipay account (email or phone)"}},"type":"object","required":["amount_cents","alipay_account"],"title":"WithdrawalRequest","description":"Worker withdrawal request","example":{"alipay_account":"worker@example.com","amount_cents":50000}},"WithdrawalResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["order_id","amount_cents","status","message"],"title":"WithdrawalResponse","description":"Withdrawal response"},"WorkerEarnings":{"properties":{"total_balance_cents":{"type":"integer","title":"Total Balance Cents"},"available_for_withdrawal_cents":{"type":"integer","title":"Available For Withdrawal Cents"},"pending_cents":{"type":"integer","title":"Pending Cents"},"total_earned_cents":{"type":"integer","title":"Total Earned Cents"},"withdrawn_cents":{"type":"integer","title":"Withdrawn Cents"}},"type":"object","required":["total_balance_cents","available_for_withdrawal_cents","pending_cents","total_earned_cents","withdrawn_cents"],"title":"WorkerEarnings","description":"Worker earnings summary."},"WorkerInfo":{"properties":{"worker_id":{"type":"string","format":"uuid","title":"Worker Id"},"worker_reputation":{"type":"number","title":"Worker Reputation"},"assigned_at":{"type":"string","format":"date-time","title":"Assigned At"},"status":{"type":"string","title":"Status"}},"type":"object","required":["worker_id","worker_reputation","assigned_at","status"],"title":"WorkerInfo","description":"Anonymized worker info in task status."},"WorkerLogin":{"properties":{"phone_number":{"type":"string","pattern":"^1[3-9]\\d{9}$","title":"Phone Number"},"password":{"type":"string","maxLength":100,"minLength":8,"title":"Password"}},"type":"object","required":["phone_number","password"],"title":"WorkerLogin","description":"Worker login request.","example":{"password":"SecurePassword123","phone_number":"13800138000"}},"WorkerRatingCreate":{"properties":{"rating":{"type":"number","maximum":5.0,"minimum":0.0,"title":"Rating","description":"Rating (0-5 stars)"},"feedback_text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Feedback Text","description":"Feedback text"}},"type":"object","required":["rating"],"title":"WorkerRatingCreate","description":"Worker rating for agent and task quality.","example":{"feedback_text":"Agent很专业，沟通顺畅，任务描述清晰","rating":4.5}},"WorkerRatingResponse":{"properties":{"message":{"type":"string","title":"Message"},"rating":{"type":"number","title":"Rating"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["message","rating","created_at"],"title":"WorkerRatingResponse","description":"Response after worker rating submission."},"WorkerRegister":{"properties":{"phone_number":{"type":"string","pattern":"^1[3-9]\\d{9}$","title":"Phone Number","description":"Chinese mobile number"},"sms_code":{"anyOf":[{"type":"string","maxLength":6,"minLength":6},{"type":"null"}],"title":"Sms Code","description":"SMS verification code (optional in sandbox mode)"},"password":{"type":"string","maxLength":100,"minLength":8,"title":"Password","description":"Account password"},"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["phone_number","password"],"title":"WorkerRegister","description":"Worker registration request.","example":{"display_name":"张三","password":"SecurePassword123","phone_number":"13800138000","sms_code":"123456"}},"WorkerResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"phone_number":{"type":"string","title":"Phone Number"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"skills":{"items":{"type":"string"},"type":"array","title":"Skills"},"reputation_score":{"type":"number","title":"Reputation Score"},"total_tasks_completed":{"type":"integer","title":"Total Tasks Completed"},"average_rating":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Rating"},"account_status":{"type":"string","title":"Account Status"},"kyc_verified":{"type":"boolean","title":"Kyc Verified"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","phone_number","skills","reputation_score","total_tasks_completed","account_status","kyc_verified","created_at"],"title":"WorkerResponse","description":"Worker profile response."},"WorkerTokenResponse":{"properties":{"worker_id":{"type":"string","format":"uuid","title":"Worker Id"},"phone_number":{"type":"string","title":"Phone Number"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In","description":"Access token expiration in seconds"}},"type":"object","required":["worker_id","phone_number","access_token","refresh_token","expires_in"],"title":"WorkerTokenResponse","description":"Worker token response with worker_id."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}