{"openapi":"3.1.0","info":{"title":"Learn Kernels API","version":"1.0.0","description":"Read-only JSON access to the Learn Kernels chapter and section index. An interactive book on GPU kernels and inference performance. The full text of every page is also available as Markdown: see https://learn-kernels.com/llms.txt.\n\n**Versioning.** The API is versioned in the URL path (`/api/v1/...`). Breaking changes ship under a new version prefix rather than changing `v1` in place; the previous version keeps working for at least 90 days after a new one ships, announced with a `Deprecation` response header and a `Sunset` date before removal.\n\n**Errors.** Every non-2xx response is JSON, shaped like the `Error` schema below: a stable machine-readable `code`, a human-readable `message`, and usually a `hint` naming the next call to make. Unknown paths under `/api/` return `404` in this same shape rather than an HTML page.\n\n**Rate limits.** Responses carry `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` headers. Exceeding the limit returns `429` with a `Retry-After` header.\n\n**Auth.** No API key or authentication is required; this is a public, read-only endpoint.\n\n**MCP.** The same data is also available as an MCP server at https://learn-kernels.com/api/mcp (tools: `list_chapters`, `get_chapter`), for MCP-native clients.","contact":{"url":"https://learn-kernels.com"}},"servers":[{"url":"https://learn-kernels.com"}],"paths":{"/api/v1/chapters":{"get":{"operationId":"listChapters","summary":"List chapters","description":"Every chapter and appendix in the book, in reading order.","responses":{"200":{"description":"The chapter list.","headers":{"RateLimit-Limit":{"description":"Requests allowed per client per window.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["chapters"],"properties":{"chapters":{"type":"array","items":{"type":"object","required":["slug","number","kind","title","tagline","status","sectionCount","url"],"properties":{"slug":{"type":"string"},"number":{"type":["integer","null"]},"kind":{"type":"string","enum":["front","chapter","appendix"]},"title":{"type":"string"},"tagline":{"type":"string"},"status":{"type":"string","enum":["ready","planned"]},"sectionCount":{"type":"integer"},"url":{"type":"string","format":"uri"}}}}}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chapters/{slug}":{"get":{"operationId":"getChapter","summary":"Get one chapter","description":"One chapter, its summary, and its sections with links.","parameters":[{"name":"slug","in":"path","required":true,"description":"The chapter slug, as returned by listChapters.","schema":{"type":"string"},"example":"introduction"}],"responses":{"200":{"description":"The chapter.","headers":{"RateLimit-Limit":{"description":"Requests allowed per client per window.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["slug","number","kind","title","tagline","status","sectionCount","url","summary","sections"],"properties":{"slug":{"type":"string"},"number":{"type":["integer","null"]},"kind":{"type":"string","enum":["front","chapter","appendix"]},"title":{"type":"string"},"tagline":{"type":"string"},"status":{"type":"string","enum":["ready","planned"]},"sectionCount":{"type":"integer"},"url":{"type":"string","format":"uri"},"summary":{"type":"string"},"sections":{"type":"array","items":{"type":"object","required":["id","number","title","url"],"properties":{"id":{"type":"string"},"number":{"type":"string"},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"subsections":{"type":"array","items":{"type":"object","required":["id","number","title"],"properties":{"id":{"type":"string"},"number":{"type":"string"},"title":{"type":"string"}}}}}}}}}}}},"404":{"description":"No chapter matches the given slug.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code.","example":"chapter_not_found"},"message":{"type":"string","description":"Human-readable explanation."},"hint":{"type":"string","description":"What to do next, when there is a clear one."}}}}}}}}