{"openapi":"3.1.0","info":{"title":"LeekCF Hinter API","version":"1.0.0","description":"Progressive hints (2 to 5 per problem, gentlest first) for Codeforces problems. Free, read-only, no API key. Hints are served only after a contest has ended, plus a 2-hour margin for system tests, so they never spoil a running round. Problem statements and editorials are not served here: use the problem link on codeforces.com. The hints are written by an AI model from the statement and, when one exists, the official editorial. They can be wrong, so check them against the editorial. Each client address may make about 60 requests per minute (HTTP 429 with Retry-After beyond that). Answers are cacheable; please cache them on your side."},"servers":[{"url":"https://leekcf-hinter-api.leekcf.workers.dev"}],"paths":{"/v1/problems/{contestId}/{index}/hints":{"get":{"operationId":"getProblemHints","summary":"Get the hints of one problem","description":"Returns every hint level of the problem, gentlest first. Reveal them one at a time in your interface so the reader is not spoiled by accident. A problem Codeforces lists in two divisions resolves to the same hints (see duplicateOf).","parameters":[{"name":"contestId","in":"path","required":true,"description":"The Codeforces contest id.","schema":{"type":"integer","minimum":1,"maximum":9999999},"example":1061},{"name":"index","in":"path","required":true,"description":"The problem letter, with a digit for split problems (A, B1, D2). Case-insensitive.","schema":{"type":"string","pattern":"^[A-Za-z][0-9]{0,2}$"},"example":"A"},{"name":"X-Client","in":"header","required":false,"description":"Optional but appreciated: the name of your app, e.g. \"my-extension/1.0\". It is used only for anonymous usage statistics per app (no addresses are stored). Wins over the client query parameter when both are sent.","schema":{"type":"string","maxLength":60},"example":"my-extension/1.0"},{"name":"client","in":"query","required":false,"description":"The same as the X-Client header, for browser apps: a plain GET with a query parameter needs no preflight request. Example: ?client=my-extension/1.0. The answer is the same with or without it.","schema":{"type":"string","maxLength":60},"example":"my-extension/1.0"}],"responses":{"200":{"description":"The hints.","headers":{"Cache-Control":{"description":"Public, cacheable for 5 minutes (CDN: 1 hour).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HintsResponse"},"example":{"problem":{"id":"1061_A","contestId":1061,"index":"A","name":"Coins","rating":800,"tags":["greedy","implementation","math"]},"duplicateOf":null,"hints":[{"level":1,"content":"To minimize the total number of coins needed to reach a target sum $S$, each coin should contribute as much as possible to the sum. What is the largest coin value available, and how much of $S$ can be covered using only that largest value?"},{"level":2,"content":"To achieve the minimum number of coins, take as many coins of the maximum value $n$ as possible. The number of full coins of value $n$ you can use is $\\lfloor S / n \\rfloor$. If $S$ is not evenly divisible by $n$, the remainder $S \\bmod n$ is strictly less than $n$, so it can be covered using exactly one additional coin of value $S \\bmod n$. Thus, the minimum number of coins required is $\\lceil S / n \\rceil$, which can be computed in $O(1)$ time using integer arithmetic as $(S + n - 1) / n$."}],"groundedInTutorial":true,"generatedAt":"2026-10-19T16:22:59.130126+00:00"}}}},"400":{"description":"The contest id or index is not a plausible Codeforces problem id (invalid_problem).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No hints are available for this problem (not_found). The same answer is given whether the problem is unknown, not processed yet, or its contest is not over, so try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (rate_limited). Wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}}},"500":{"description":"Something unexpected went wrong on our side (internal). Please report it if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The service is temporarily unavailable (unavailable). Try again shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"operationId":"getHealth","summary":"Liveness check","responses":{"200":{"description":"The service is up.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"]},"example":{"status":"ok"}}}}}}}},"components":{"schemas":{"HintsResponse":{"type":"object","properties":{"problem":{"$ref":"#/components/schemas/Problem"},"duplicateOf":{"type":["string","null"],"description":"When this problem is the same as another one (Div. 1 and Div. 2 versions), the id of the problem that holds the hints; otherwise null."},"hints":{"type":"array","minItems":2,"maxItems":5,"items":{"$ref":"#/components/schemas/Hint"},"description":"Gentlest first; the last hint is the complete solution."},"groundedInTutorial":{"type":"boolean","description":"True when the hints were written with the official editorial at hand; false when the model had only the statement."},"generatedAt":{"type":"string","format":"date-time"}},"required":["problem","duplicateOf","hints","groundedInTutorial","generatedAt"]},"Problem":{"type":"object","properties":{"id":{"type":"string","description":"contestId_index, e.g. 1944_C"},"contestId":{"type":"integer"},"index":{"type":"string"},"name":{"type":"string"},"rating":{"type":["integer","null"],"description":"Codeforces difficulty rating; null when unrated."},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","contestId","index","name","rating","tags"]},"Hint":{"type":"object","properties":{"level":{"type":"integer","minimum":1,"maximum":5},"content":{"type":"string","description":"Markdown; math is written between single dollar signs."}},"required":["level","content"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_problem","not_found","rate_limited","unavailable","method_not_allowed","internal"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}