{
  "openapi": "3.1.0",
  "info": {
    "title": "Human Test Desk API",
    "version": "0.2.0",
    "description": "Free asynchronous human usability testing. No card or checkout. Authenticate once with a workspace API key; check queue availability before submitting."
  },
  "servers": [
    {
      "url": "https://human-test-desk.newvideocreator.chatgpt.site"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getService",
        "summary": "Check price, scope, availability and payment readiness",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "409": {
            "description": "Conflict or full queue"
          },
          "503": {
            "description": "Pilot paused or unavailable"
          }
        },
        "security": []
      }
    },
    "/api/tests": {
      "get": {
        "operationId": "listTests",
        "summary": "List your tests",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "409": {
            "description": "Conflict or full queue"
          },
          "503": {
            "description": "Pilot paused or unavailable"
          }
        }
      },
      "post": {
        "operationId": "requestTest",
        "summary": "Queue a free human usability test; no payment",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "409": {
            "description": "Conflict or full queue"
          },
          "503": {
            "description": "Pilot paused or unavailable"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestRequest"
              }
            }
          }
        }
      }
    },
    "/api/tests/{id}": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getTest",
        "summary": "Read your test and human report",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "409": {
            "description": "Conflict or full queue"
          },
          "503": {
            "description": "Pilot paused or unavailable"
          }
        }
      },
      "post": {
        "operationId": "cancelTest",
        "summary": "Cancel your unfinished test",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Authentication required"
          },
          "409": {
            "description": "Conflict or full queue"
          },
          "503": {
            "description": "Pilot paused or unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "const": "cancel"
                  }
                },
                "required": [
                  "action"
                ]
              }
            }
          }
        }
      }
    },
    "/api/waitlist": {
      "post": {
        "operationId": "joinWaitlist",
        "summary": "Join optional pilot updates with email-owner consent",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "consent"
                ],
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254
                  },
                  "interest": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "consent": {
                    "type": "boolean",
                    "const": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signup saved, or already registered. No confirmation email sent."
          },
          "400": {
            "description": "Invalid email or missing consent"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "htd_ API key"
      }
    },
    "schemas": {
      "TestRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "tasks"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public HTTPS URL with no query, fragment, or credentials"
          },
          "tasks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "items": {
              "type": "string",
              "minLength": 5,
              "maxLength": 500
            }
          },
          "context": {
            "type": "string",
            "maxLength": 2000
          },
          "device": {
            "type": "string",
            "enum": [
              "desktop",
              "mobile"
            ],
            "default": "desktop"
          }
        }
      }
    }
  }
}
