{
    "swagger": "2.0",
    "info": {
        "description": "This is the worker API for the Dojo project.",
        "title": "Dojo Worker API",
        "contact": {},
        "version": "1.0"
    },
    "paths": {
        "/api/v1/auth/{address}": {
            "get": {
                "description": "Generates cookies that can be used to authenticate a user, given a valid signature, message for a specific hotkey",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Authentication"
                ],
                "summary": "Generates a session given valid proof of ownership",
                "parameters": [
                    {
                        "description": "Request body containing the hotkey, signature, and message",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/auth.GenerateCookieAuthRequest"
                        }
                    },
                    {
                        "type": "string",
                        "description": "Wallet address",
                        "name": "address",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Nonce generated successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/worker.GenerateNonceResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Failed to generate session",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/auth/{address}": {
            "get": {
                "description": "Generate a nonce for a given wallet address",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Authentication"
                ],
                "summary": "Generate nonce",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Wallet address",
                        "name": "address",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Nonce generated successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/worker.GenerateNonceResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Address parameter is required",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Failed to store nonce",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/metrics/average-task-completion-time": {
            "get": {
                "description": "Retrieves the average task completion time from the metrics data",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Metrics"
                ],
                "summary": "Get the average task completion time",
                "responses": {
                    "200": {
                        "description": "Average task completion time retrieved successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/metric.AvgTaskCompletionTimeResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Failed to get average task completion time or unmarshal data",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/metrics/completed-tasks-count": {
            "get": {
                "description": "Retrieves the total number of completed tasks from the metrics data",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Metrics"
                ],
                "summary": "Get the total number of completed tasks",
                "responses": {
                    "200": {
                        "description": "Total number of completed tasks retrieved successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/metric.CompletedTaskCountResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Failed to get completed tasks count or unmarshal data",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/metrics/dojo-worker-count": {
            "get": {
                "description": "Retrieves the total number of Dojo workers from the metrics data",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Metrics"
                ],
                "summary": "Get the total number of Dojo workers",
                "responses": {
                    "200": {
                        "description": "Total number of Dojo workers retrieved successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/metric.DojoWorkerCountResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Failed to get worker count or unmarshal data",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/metrics/task-result-count": {
            "get": {
                "description": "Retrieves the total number of task results from the metrics data",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Metrics"
                ],
                "summary": "Get the total number of task results",
                "responses": {
                    "200": {
                        "description": "Total number of task results retrieved successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/metric.TaskResultCountResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Failed to get task results count or unmarshal data",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/miner/api-keys": {
            "post": {
                "description": "Generate a new API key associated with the miner's hotkey",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Miner"
                ],
                "summary": "Generate a new API key for a miner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully generated API key",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/miner.MinerApiKeysResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/miner/api-keys/disable": {
            "put": {
                "description": "Disable a specific API key associated with the miner's hotkey",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Miner"
                ],
                "summary": "Disable an API key for a miner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Disable API key request body",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/miner.MinerApiKeyDisableRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully disabled API key",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/miner.MinerApiKeysResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "API key not found",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/miner/subscription-keys": {
            "get": {
                "description": "Get a list of subscription keys associated with the miner's hotkey",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Miner"
                ],
                "summary": "Retrieve subscription keys for a miner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved subscription keys",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/miner.MinerSubscriptionKeysResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Generate a new subscription key associated with the miner's hotkey",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Miner"
                ],
                "summary": "Generate a new subscription key for a miner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully generated subscription key",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/miner.MinerSubscriptionKeysResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/miner/subscription-keys/disable": {
            "put": {
                "description": "Disable a specific subscription key associated with the miner's hotkey",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Miner"
                ],
                "summary": "Disable a subscription key for a miner",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Disable subscription key request body",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/miner.MinerSubscriptionDisableRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully disabled subscription key",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/miner.MinerSubscriptionKeysResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "Subscription key not found",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/next-in-progress-task/{task-id}": {
            "get": {
                "description": "Fetch the next in-progress task by providing the task ID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Tasks"
                ],
                "summary": "Get next in-progress task by task ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Task ID",
                        "name": "task-id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/task.NextTaskResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request, task id is required",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Failed to get next in-progress task",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/partner/edit": {
            "put": {
                "description": "Update the subscription key and name of a worker partner",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Worker Partner"
                ],
                "summary": "Update worker partner details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Request body containing the details to update",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/worker.UpdateWorkerPartnerRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully updated worker partner",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/worker.UpdateWorkerPartnerResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body or missing required parameters",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error - failed to update worker partner",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/tasks": {
            "get": {
                "description": "Get a paginated list of tasks based on the specified parameters",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Tasks"
                ],
                "summary": "Retrieve tasks by pagination",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Comma-separated list of task types (e.g., CODE_GENERATION,TEXT_TO_IMAGE,DIALOGUE). Use 'All' to include all types.",
                        "name": "task",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page number (default is 1)",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Number of tasks per page (default is 10)",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Sort field (default is createdAt)",
                        "name": "sort",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Order field (default is desc order) e.g., asc or desc",
                        "name": "order",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved task pagination response",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/task.TaskPagination"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "No tasks found",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/tasks/create": {
            "post": {
                "description": "Create tasks by providing the necessary task details along with files to upload. This endpoint accepts multipart/form-data, and multiple files can be uploaded.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Tasks"
                ],
                "summary": "Create Tasks",
                "parameters": [
                    {
                        "type": "string",
                        "description": "API Key for Miner Authentication",
                        "name": "x-api-key",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Content-Type: multipart/form-data",
                        "name": "Content-Type",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Title of the task",
                        "name": "Title",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Body of the task",
                        "name": "Body",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Expiration date of the task",
                        "name": "ExpireAt",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Task data in JSON format",
                        "name": "TaskData",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Maximum results",
                        "name": "MaxResults",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "number",
                        "description": "Total rewards",
                        "name": "TotalRewards",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "file"
                        },
                        "collectionFormat": "csv",
                        "description": "Files to upload (can upload multiple files)",
                        "name": "files",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tasks created successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Bad request, invalid form data, or failed to process request",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized access",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error, failed to upload files",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/tasks/submit-result/{task-id}": {
            "put": {
                "description": "Submit the result of a task",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Tasks"
                ],
                "summary": "Submit task result",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Task ID",
                        "name": "task-id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Request body containing the task result data",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/task.SubmitTaskResultRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task result submitted successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/task.SubmitTaskResultResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body or task is expired",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "Task not found",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "409": {
                        "description": "Task has reached max results",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/tasks/{task-id}": {
            "get": {
                "description": "Get details of a task by its ID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Tasks"
                ],
                "summary": "Retrieve task by ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Task ID",
                        "name": "task-id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved task response",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/task.TaskResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "404": {
                        "description": "Task not found",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/worker/login/auth": {
            "post": {
                "description": "Log in a worker by providing their wallet address, chain ID, message, signature, and timestamp",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Authentication"
                ],
                "summary": "Worker login",
                "parameters": [
                    {
                        "description": "Request body containing the worker login details",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/worker.WorkerLoginRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Worker logged in successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/worker.WorkerLoginSuccessResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid wallet address or chain ID",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized access",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden access",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "409": {
                        "description": "Worker already exists",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Failed to create worker",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/worker/partner": {
            "post": {
                "description": "Create a partnership between a worker and a miner",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Worker Partner"
                ],
                "summary": "Create worker-miner partnership",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Request body containing the name and miner subscription key",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/worker.WorkerPartnerCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully created worker-miner partnership",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "type": "string"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body or missing required fields",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "Miner subscription key is invalid",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/worker/partner/disable": {
            "put": {
                "description": "Disable a miner by providing the worker subscription key and a disable flag",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Worker Partner"
                ],
                "summary": "Disable miner by worker",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Request body containing the miner subscription key and disable flag",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/worker.DisableMinerRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Miner disabled successfully",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/worker.DisableSuccessResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request body or parameters",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "Failed to disable worker partner, no records updated",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error - failed to disable worker partner",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        },
        "/worker/partner/list": {
            "get": {
                "description": "Retrieve a list of partnerships between a worker and miners",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Worker Partner"
                ],
                "summary": "Get worker-miner partnership list",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bearer token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved worker-miner partnership list",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/api.ApiResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "body": {
                                            "$ref": "#/definitions/worker.ListWorkerPartnersResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "400": {
                        "description": "Invalid request or missing required fields",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "404": {
                        "description": "Worker not found",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/api.ApiResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "api.ApiResponse": {
            "type": "object",
            "properties": {
                "body": {},
                "error": {},
                "success": {
                    "type": "boolean"
                }
            }
        },
        "auth.GenerateCookieAuthRequest": {
            "type": "object",
            "properties": {
                "hotkey": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "signature": {
                    "type": "string"
                }
            }
        },
        "db.TaskStatus": {
            "type": "string",
            "enum": [
                "IN_PROGRESS",
                "COMPLETED",
                "EXPIRED"
            ],
            "x-enum-varnames": [
                "TaskStatusInProgress",
                "TaskStatusCompleted",
                "TaskStatusExpired"
            ]
        },
        "db.TaskType": {
            "type": "string",
            "enum": [
                "CODE_GENERATION",
                "DIALOGUE",
                "TEXT_TO_IMAGE",
                "TEXT_TO_THREE_D"
            ],
            "x-enum-varnames": [
                "TaskTypeCodeGeneration",
                "TaskTypeDialogue",
                "TaskTypeTextToImage",
                "TaskTypeTextToThreeD"
            ]
        },
        "metric.AvgTaskCompletionTimeResponse": {
            "type": "object",
            "properties": {
                "averageTaskCompletionTime": {
                    "type": "integer"
                }
            }
        },
        "metric.CompletedTaskCountResponse": {
            "type": "object",
            "properties": {
                "numCompletedTasks": {
                    "type": "integer"
                }
            }
        },
        "metric.DojoWorkerCountResponse": {
            "type": "object",
            "properties": {
                "numDojoWorkers": {
                    "type": "integer"
                }
            }
        },
        "metric.TaskResultCountResponse": {
            "type": "object",
            "properties": {
                "numTaskResults": {
                    "type": "integer"
                }
            }
        },
        "miner.MinerApiKeyDisableRequest": {
            "type": "object",
            "properties": {
                "apiKey": {
                    "type": "string"
                }
            }
        },
        "miner.MinerApiKeysResponse": {
            "type": "object",
            "properties": {
                "apiKeys": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "miner.MinerSubscriptionDisableRequest": {
            "type": "object",
            "properties": {
                "subscriptionKey": {
                    "type": "string"
                }
            }
        },
        "miner.MinerSubscriptionKeysResponse": {
            "type": "object",
            "properties": {
                "subscriptionKeys": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "task.NextTaskResponse": {
            "type": "object",
            "properties": {
                "nextInProgressTaskId": {
                    "type": "string"
                }
            }
        },
        "task.Pagination": {
            "type": "object",
            "properties": {
                "pageNumber": {
                    "type": "integer"
                },
                "pageSize": {
                    "type": "integer"
                },
                "totalItems": {
                    "type": "integer"
                },
                "totalPages": {
                    "type": "integer"
                }
            }
        },
        "task.Result": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string"
                },
                "value": {}
            }
        },
        "task.SubmitTaskResultRequest": {
            "type": "object",
            "required": [
                "resultData"
            ],
            "properties": {
                "resultData": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/task.Result"
                    }
                }
            }
        },
        "task.SubmitTaskResultResponse": {
            "type": "object",
            "properties": {
                "numResults": {
                    "type": "integer"
                }
            }
        },
        "task.TaskPagination": {
            "type": "object",
            "properties": {
                "pagination": {
                    "$ref": "#/definitions/task.Pagination"
                },
                "tasks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/task.TaskPaginationResponse"
                    }
                }
            }
        },
        "task.TaskPaginationResponse": {
            "type": "object",
            "properties": {
                "body": {
                    "type": "string"
                },
                "expireAt": {
                    "type": "string"
                },
                "isCompletedByWorker": {
                    "type": "boolean"
                },
                "maxResults": {
                    "type": "integer"
                },
                "numCriteria": {
                    "type": "integer"
                },
                "numResults": {
                    "type": "integer"
                },
                "status": {
                    "$ref": "#/definitions/db.TaskStatus"
                },
                "taskData": {},
                "taskId": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/db.TaskType"
                }
            }
        },
        "task.TaskResponse": {
            "type": "object",
            "properties": {
                "body": {
                    "type": "string"
                },
                "expireAt": {
                    "type": "string"
                },
                "maxResults": {
                    "type": "integer"
                },
                "numCriteria": {
                    "type": "integer"
                },
                "numResults": {
                    "type": "integer"
                },
                "status": {
                    "$ref": "#/definitions/db.TaskStatus"
                },
                "taskData": {},
                "taskId": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/db.TaskType"
                }
            }
        },
        "worker.DisableMinerRequest": {
            "type": "object",
            "required": [
                "minerSubscriptionKey",
                "toDisable"
            ],
            "properties": {
                "minerSubscriptionKey": {
                    "type": "string"
                },
                "toDisable": {
                    "type": "boolean"
                }
            }
        },
        "worker.DisableSuccessResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                }
            }
        },
        "worker.GenerateNonceResponse": {
            "type": "object",
            "properties": {
                "nonce": {
                    "type": "string"
                }
            }
        },
        "worker.ListWorkerPartnersResponse": {
            "type": "object",
            "properties": {
                "partners": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/worker.WorkerPartner"
                    }
                }
            }
        },
        "worker.UpdateWorkerPartnerRequest": {
            "type": "object",
            "required": [
                "minerSubscriptionKey",
                "name",
                "newMinerSubscriptionKey"
            ],
            "properties": {
                "minerSubscriptionKey": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "newMinerSubscriptionKey": {
                    "type": "string"
                }
            }
        },
        "worker.UpdateWorkerPartnerResponse": {
            "type": "object",
            "properties": {
                "workerPartner": {
                    "$ref": "#/definitions/worker.WorkerPartner"
                }
            }
        },
        "worker.WorkerLoginRequest": {
            "type": "object",
            "required": [
                "chainId",
                "message",
                "signature",
                "timestamp",
                "walletAddress"
            ],
            "properties": {
                "chainId": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "signature": {
                    "type": "string"
                },
                "timestamp": {
                    "type": "string"
                },
                "walletAddress": {
                    "type": "string"
                }
            }
        },
        "worker.WorkerLoginSuccessResponse": {
            "type": "object",
            "properties": {
                "token": {}
            }
        },
        "worker.WorkerPartner": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "subscriptionKey": {
                    "type": "string"
                }
            }
        },
        "worker.WorkerPartnerCreateRequest": {
            "type": "object",
            "required": [
                "minerSubscriptionKey",
                "name"
            ],
            "properties": {
                "minerSubscriptionKey": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        }
    }
}
