{
    "openapi": "3.1.1",
    "info": {
        "title": "UNSOLVED registry API",
        "version": "1.0.0",
        "summary": "Read-only access to the numbered registry of open problems in AI.",
        "description": "Every numbered problem in the UNSOLVED registry, with its statement, status and verdict, exactly as its page on https://unsolved.how shows them. Cite a problem as UNSOLVED-{n}, with its address.\n\nRead-only and open: no key, no account, no cookies. Sixty requests a minute per address; every response says what is left in the RateLimit-Policy and RateLimit headers, and a 429 says how many seconds to wait in Retry-After. Errors are problem details (RFC 9457).\n\nThe version is in the path. Version 1 may gain fields; a change that renames or removes one comes as a new version at a new path.",
        "termsOfService": "https://unsolved.how/terms",
        "contact": {
            "name": "UNSOLVED",
            "url": "https://unsolved.how",
            "email": "contact@unsolved.how"
        }
    },
    "externalDocs": {
        "description": "A guide to the site for AI tools",
        "url": "https://unsolved.how/llms.txt"
    },
    "servers": [
        {
            "url": "https://unsolved.how/api/v1"
        }
    ],
    "security": [],
    "tags": [
        {
            "name": "Problems",
            "description": "The numbered problems of the registry."
        }
    ],
    "paths": {
        "/problems": {
            "get": {
                "operationId": "listProblems",
                "tags": [
                    "Problems"
                ],
                "summary": "List every problem",
                "description": "Every numbered problem in the registry, in number order, with its full statement. The registry is small, so the list comes whole, without pages.",
                "responses": {
                    "200": {
                        "description": "Every problem, in number order.",
                        "headers": {
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimit-Policy"
                            },
                            "RateLimit": {
                                "$ref": "#/components/headers/RateLimit"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemList"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests from this address. Wait the number of seconds in Retry-After.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimit-Policy"
                            },
                            "RateLimit": {
                                "$ref": "#/components/headers/RateLimit"
                            },
                            "Retry-After": {
                                "$ref": "#/components/headers/Retry-After"
                            }
                        }
                    }
                }
            }
        },
        "/problems/{number}": {
            "get": {
                "operationId": "getProblem",
                "tags": [
                    "Problems"
                ],
                "summary": "Get one problem",
                "description": "One problem by its registry number, such as 6 for №6 (UNSOLVED-6).",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "description": "The registry number, such as 6 for №6.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The problem.",
                        "headers": {
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimit-Policy"
                            },
                            "RateLimit": {
                                "$ref": "#/components/headers/RateLimit"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemEntry"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "There is no problem with this number.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests from this address. Wait the number of seconds in Retry-After.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProblemDetails"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Policy": {
                                "$ref": "#/components/headers/RateLimit-Policy"
                            },
                            "RateLimit": {
                                "$ref": "#/components/headers/RateLimit"
                            },
                            "Retry-After": {
                                "$ref": "#/components/headers/Retry-After"
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ProblemList": {
                "type": "object",
                "required": [
                    "data"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Problem"
                        }
                    }
                }
            },
            "ProblemEntry": {
                "type": "object",
                "required": [
                    "data"
                ],
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Problem"
                    }
                }
            },
            "Problem": {
                "type": "object",
                "description": "A numbered problem, as its page shows it.",
                "required": [
                    "number",
                    "citation",
                    "url",
                    "title",
                    "topic",
                    "tagline",
                    "status",
                    "field",
                    "statement",
                    "solved"
                ],
                "properties": {
                    "number": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "The registry number, shown on the site as №{n}. Permanent and never reused."
                    },
                    "citation": {
                        "type": "string",
                        "pattern": "^UNSOLVED-[0-9]+$",
                        "description": "How to cite the problem: UNSOLVED-{n}.",
                        "examples": [
                            "UNSOLVED-6"
                        ]
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "The problem’s page."
                    },
                    "title": {
                        "type": "string",
                        "description": "The problem in one line."
                    },
                    "topic": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "What people call the problem, as it reads mid-sentence, such as \"prompt injection\". Null when it has none."
                    },
                    "tagline": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The problem in a short phrase, as search results and link previews describe it. Null when it has none."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "progress",
                            "solved"
                        ],
                        "description": "Where the problem stands: open; progress (in progress: a verified contribution has moved it); or solved."
                    },
                    "field": {
                        "$ref": "#/components/schemas/Field"
                    },
                    "statement": {
                        "$ref": "#/components/schemas/Statement"
                    },
                    "solved": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/Solve"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The verified solve. Null while the problem is open or in progress."
                    }
                }
            },
            "Field": {
                "type": "object",
                "description": "The field the problem belongs to.",
                "required": [
                    "name",
                    "slug"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The field’s name, such as \"Robustness & security\"."
                    },
                    "slug": {
                        "type": "string",
                        "description": "The field’s name in addresses, such as robustness-security."
                    }
                }
            },
            "Statement": {
                "type": "object",
                "description": "The problem as stated, in the version its page shows.",
                "required": [
                    "version",
                    "what",
                    "why",
                    "progress",
                    "stated_by",
                    "stamped_on",
                    "stamped_at"
                ],
                "properties": {
                    "version": {
                        "type": "string",
                        "pattern": "^[0-9]+\\.[0-9]+$",
                        "description": "The statement’s version, such as 1.0. A refinement raises it."
                    },
                    "what": {
                        "type": "string",
                        "description": "What needs solving."
                    },
                    "why": {
                        "type": "string",
                        "description": "Why it matters."
                    },
                    "progress": {
                        "type": "string",
                        "description": "What counts as progress."
                    },
                    "stated_by": {
                        "$ref": "#/components/schemas/Person"
                    },
                    "stamped_on": {
                        "type": "string",
                        "format": "date",
                        "description": "When this version was stamped."
                    },
                    "stamped_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Where it was stamped, such as \"Founding registry\". Null when not recorded."
                    }
                }
            },
            "Solve": {
                "type": "object",
                "description": "A verified solve.",
                "required": [
                    "on",
                    "by",
                    "verified_by",
                    "patron"
                ],
                "properties": {
                    "on": {
                        "type": "string",
                        "format": "date",
                        "description": "The date of the solve."
                    },
                    "by": {
                        "$ref": "#/components/schemas/Person"
                    },
                    "verified_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Who verified the solve: \"UNSOLVED review board\" for the board’s verdicts, or an outside verifier."
                    },
                    "patron": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "The problem’s patron when the solve was verified. Null when it had none."
                    }
                }
            },
            "Person": {
                "type": "object",
                "description": "Who stated or solved a problem.",
                "required": [
                    "name",
                    "affiliation"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "A person, a team or a system."
                    },
                    "affiliation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Their organisation. Null when none is given."
                    }
                }
            },
            "ProblemDetails": {
                "type": "object",
                "description": "An error as problem details (RFC 9457).",
                "required": [
                    "type",
                    "title",
                    "status"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "The kind of error: about:blank, because the status says it all."
                    },
                    "title": {
                        "type": "string",
                        "description": "The status’s standard name, such as \"Not Found\"."
                    },
                    "status": {
                        "type": "integer",
                        "description": "The HTTP status code."
                    },
                    "detail": {
                        "type": "string",
                        "description": "What went wrong and what to do instead, where it helps."
                    }
                }
            }
        },
        "headers": {
            "RateLimit-Policy": {
                "description": "The quota: q requests in a window of w seconds, such as \"api\";q=60;w=60.",
                "schema": {
                    "type": "string"
                }
            },
            "RateLimit": {
                "description": "What is left: r requests until the window resets in t seconds, such as \"api\";r=59;t=60.",
                "schema": {
                    "type": "string"
                }
            },
            "Retry-After": {
                "description": "Seconds to wait before the next request.",
                "schema": {
                    "type": "integer",
                    "minimum": 0
                }
            }
        }
    }
}