{
 "openapi": "3.1.0",
 "info": {
  "title": "AI Coding Dictionary API",
  "version": "1.1.0",
  "description": "The vocabulary of AI coding, translated into plain English. Every operation only reads and needs no sign-in. One address may send 60 requests per 60 seconds. The same tools are an MCP server at https://ai9k.vercel.app/api/mcp."
 },
 "servers": [
  {
   "url": "https://ai9k.vercel.app"
  }
 ],
 "externalDocs": {
  "description": "How to connect an agent",
  "url": "https://ai9k.vercel.app/en/agents"
 },
 "paths": {
  "/api/v1": {
   "get": {
    "operationId": "list_tools",
    "summary": "List the tools",
    "description": "What the API offers: each tool with its address, its parameters and an example that works.",
    "responses": {
     "200": {
      "description": "The tools.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     }
    }
   }
  },
  "/api/v1/get_overview": {
   "get": {
    "operationId": "get_overview",
    "summary": "Overview of the dictionary",
    "description": "What this dictionary covers: the number of terms, the curriculum sections in teaching order, the languages, and the files the site publishes for machines. Takes no required arguments. Use this first when you do not yet know whether the dictionary can answer the question.",
    "parameters": [
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in.",
      "schema": {
       "type": "string",
       "enum": [
        "vi",
        "en"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "description": {
           "type": "string"
          },
          "site": {
           "type": "string"
          },
          "languages": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "default_language": {
           "type": "string"
          },
          "corpus_version": {
           "type": "string"
          },
          "term_count": {
           "type": "integer"
          },
          "sections": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "number": {
              "type": "integer"
             },
             "title": {
              "type": "string"
             },
             "term_count": {
              "type": "integer"
             },
             "terms": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            },
            "required": [
             "number",
             "title",
             "term_count",
             "terms"
            ]
           }
          },
          "files": {
           "type": "object",
           "additionalProperties": {
            "type": "string"
           }
          },
          "pages": {
           "type": "object",
           "description": "Pages for a person: the map of all terms, the step-by-step course, the curriculum and the A to Z list.",
           "properties": {
            "map": {
             "type": "string"
            },
            "learn": {
             "type": "string"
            },
            "curriculum": {
             "type": "string"
            },
            "a_z": {
             "type": "string"
            }
           },
           "required": [
            "map",
            "learn",
            "curriculum",
            "a_z"
           ]
          },
          "repository": {
           "type": "string"
          },
          "upstream": {
           "type": "string"
          }
         },
         "required": [
          "name",
          "description",
          "site",
          "languages",
          "default_language",
          "corpus_version",
          "term_count",
          "sections",
          "files",
          "pages",
          "repository",
          "upstream"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   },
   "post": {
    "operationId": "get_overview_post",
    "summary": "Overview of the dictionary (POST)",
    "description": "The same call, with the parameters as a JSON object in the body.",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "lang": {
          "type": "string",
          "enum": [
           "vi",
           "en"
          ],
          "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in."
         }
        }
       },
       "example": {}
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "description": {
           "type": "string"
          },
          "site": {
           "type": "string"
          },
          "languages": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "default_language": {
           "type": "string"
          },
          "corpus_version": {
           "type": "string"
          },
          "term_count": {
           "type": "integer"
          },
          "sections": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "number": {
              "type": "integer"
             },
             "title": {
              "type": "string"
             },
             "term_count": {
              "type": "integer"
             },
             "terms": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            },
            "required": [
             "number",
             "title",
             "term_count",
             "terms"
            ]
           }
          },
          "files": {
           "type": "object",
           "additionalProperties": {
            "type": "string"
           }
          },
          "pages": {
           "type": "object",
           "description": "Pages for a person: the map of all terms, the step-by-step course, the curriculum and the A to Z list.",
           "properties": {
            "map": {
             "type": "string"
            },
            "learn": {
             "type": "string"
            },
            "curriculum": {
             "type": "string"
            },
            "a_z": {
             "type": "string"
            }
           },
           "required": [
            "map",
            "learn",
            "curriculum",
            "a_z"
           ]
          },
          "repository": {
           "type": "string"
          },
          "upstream": {
           "type": "string"
          }
         },
         "required": [
          "name",
          "description",
          "site",
          "languages",
          "default_language",
          "corpus_version",
          "term_count",
          "sections",
          "files",
          "pages",
          "repository",
          "upstream"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/api/v1/search": {
   "get": {
    "operationId": "search",
    "summary": "Search the dictionary",
    "description": "Find terms by words. Matching ignores accents and letter case, and looks at the English and the Vietnamese text together, so query in the user's own words in either language. A word that few terms use counts for more than a common one, and a hit in the term's name counts for more than one in its text. A term whose whole name appears in the query comes first. A result that scores under a tenth of the best one is left out, so the list is short rather than noisy. This is word matching, not a search by meaning: when a question returns nothing useful, retry with the key noun. Use this when you have words or a question and no slug, then call get_term with a slug from the results.",
    "parameters": [
     {
      "name": "query",
      "in": "query",
      "required": true,
      "description": "Words to look for, at most 200 characters.",
      "schema": {
       "type": "string"
      },
      "example": "context window"
     },
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in.",
      "schema": {
       "type": "string",
       "enum": [
        "vi",
        "en"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "How many results to return, 1 to 20. The default is 8.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 20
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "query": {
           "type": "string"
          },
          "lang": {
           "type": "string"
          },
          "total": {
           "type": "integer",
           "description": "How many terms matched, before the limit."
          },
          "results": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             },
             "name": {
              "type": [
               "string",
               "null"
              ]
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             },
             "score": {
              "type": "number"
             },
             "matched_fields": {
              "type": "array",
              "items": {
               "type": "string",
               "enum": [
                "name",
                "description",
                "body"
               ]
              }
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url",
             "score",
             "matched_fields"
            ]
           }
          }
         },
         "required": [
          "query",
          "lang",
          "total",
          "results"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   },
   "post": {
    "operationId": "search_post",
    "summary": "Search the dictionary (POST)",
    "description": "The same call, with the parameters as a JSON object in the body.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "query": {
          "type": "string",
          "description": "Words to look for, at most 200 characters."
         },
         "lang": {
          "type": "string",
          "enum": [
           "vi",
           "en"
          ],
          "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in."
         },
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 20,
          "description": "How many results to return, 1 to 20. The default is 8."
         }
        },
        "required": [
         "query"
        ]
       },
       "example": {
        "query": "context window"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "query": {
           "type": "string"
          },
          "lang": {
           "type": "string"
          },
          "total": {
           "type": "integer",
           "description": "How many terms matched, before the limit."
          },
          "results": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             },
             "name": {
              "type": [
               "string",
               "null"
              ]
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             },
             "score": {
              "type": "number"
             },
             "matched_fields": {
              "type": "array",
              "items": {
               "type": "string",
               "enum": [
                "name",
                "description",
                "body"
               ]
              }
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url",
             "score",
             "matched_fields"
            ]
           }
          }
         },
         "required": [
          "query",
          "lang",
          "total",
          "results"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/api/v1/get_term": {
   "get": {
    "operationId": "get_term",
    "summary": "Read one term",
    "description": "The full entry of one term: its description, the body and the usage dialogue as markdown, its section, the terms it links to and the terms that link to it, and the addresses of the term in the Learn view and on the map. Pass a slug such as \"context-window\"; the English term or its Vietnamese name also works. An unknown slug is not a dead end: found is false and suggestions names the nearest terms to retry with. Use this once search, get_section or get_related has given you a slug.",
    "parameters": [
     {
      "name": "slug",
      "in": "query",
      "required": true,
      "description": "The term's slug, such as \"context-window\".",
      "schema": {
       "type": "string"
      },
      "example": "context-window"
     },
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in.",
      "schema": {
       "type": "string",
       "enum": [
        "vi",
        "en"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "query": {
           "type": "string"
          },
          "term": {
           "type": "object",
           "properties": {
            "slug": {
             "type": "string"
            },
            "term": {
             "type": "string"
            },
            "name": {
             "type": [
              "string",
              "null"
             ]
            },
            "description": {
             "type": "string"
            },
            "section": {
             "type": "object",
             "properties": {
              "number": {
               "type": "integer"
              },
              "title": {
               "type": "string"
              }
             },
             "required": [
              "number",
              "title"
             ]
            },
            "url": {
             "type": "string"
            },
            "position": {
             "type": "integer",
             "description": "Place in the teaching order, from 1."
            },
            "body": {
             "type": "string",
             "description": "Markdown."
            },
            "usage": {
             "type": "string",
             "description": "A short dialogue that uses the term, as markdown. Empty when the entry has none."
            },
            "translated": {
             "type": "boolean",
             "description": "False when the chosen language has no translation and the English text is returned."
            },
            "links_to": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "slug": {
                "type": "string"
               },
               "term": {
                "type": "string",
                "description": "The English term."
               },
               "name": {
                "type": [
                 "string",
                 "null"
                ],
                "description": "The term's name in the chosen language, when it has one."
               },
               "description": {
                "type": "string"
               },
               "section": {
                "type": "object",
                "properties": {
                 "number": {
                  "type": "integer"
                 },
                 "title": {
                  "type": "string"
                 }
                },
                "required": [
                 "number",
                 "title"
                ]
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "slug",
               "term",
               "name",
               "description",
               "section",
               "url"
              ]
             }
            },
            "linked_from": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "slug": {
                "type": "string"
               },
               "term": {
                "type": "string",
                "description": "The English term."
               },
               "name": {
                "type": [
                 "string",
                 "null"
                ],
                "description": "The term's name in the chosen language, when it has one."
               },
               "description": {
                "type": "string"
               },
               "section": {
                "type": "object",
                "properties": {
                 "number": {
                  "type": "integer"
                 },
                 "title": {
                  "type": "string"
                 }
                },
                "required": [
                 "number",
                 "title"
                ]
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "slug",
               "term",
               "name",
               "description",
               "section",
               "url"
              ]
             }
            },
            "data_url": {
             "type": "string",
             "description": "The same entry as a JSON file, in every language."
            },
            "markdown_url": {
             "type": "string",
             "description": "The same entry as a markdown file."
            },
            "learn_url": {
             "type": "string",
             "description": "The term in the Learn view, which teaches it step by step. Offer it when the user wants to study the term."
            },
            "map_url": {
             "type": "string",
             "description": "The term on the map of all terms, with its links drawn. Offer it when the user wants to see what it connects to."
            }
           },
           "required": [
            "slug",
            "term",
            "name",
            "description",
            "section",
            "url",
            "position",
            "body",
            "usage",
            "translated",
            "links_to",
            "linked_from",
            "data_url",
            "markdown_url",
            "learn_url",
            "map_url"
           ]
          },
          "suggestions": {
           "type": "array",
           "description": "Terms the caller may have meant. Retry with one of these slugs.",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term"
            ]
           }
          }
         },
         "required": [
          "found",
          "query"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   },
   "post": {
    "operationId": "get_term_post",
    "summary": "Read one term (POST)",
    "description": "The same call, with the parameters as a JSON object in the body.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "slug": {
          "type": "string",
          "description": "The term's slug, such as \"context-window\"."
         },
         "lang": {
          "type": "string",
          "enum": [
           "vi",
           "en"
          ],
          "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in."
         }
        },
        "required": [
         "slug"
        ]
       },
       "example": {
        "slug": "context-window"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "query": {
           "type": "string"
          },
          "term": {
           "type": "object",
           "properties": {
            "slug": {
             "type": "string"
            },
            "term": {
             "type": "string"
            },
            "name": {
             "type": [
              "string",
              "null"
             ]
            },
            "description": {
             "type": "string"
            },
            "section": {
             "type": "object",
             "properties": {
              "number": {
               "type": "integer"
              },
              "title": {
               "type": "string"
              }
             },
             "required": [
              "number",
              "title"
             ]
            },
            "url": {
             "type": "string"
            },
            "position": {
             "type": "integer",
             "description": "Place in the teaching order, from 1."
            },
            "body": {
             "type": "string",
             "description": "Markdown."
            },
            "usage": {
             "type": "string",
             "description": "A short dialogue that uses the term, as markdown. Empty when the entry has none."
            },
            "translated": {
             "type": "boolean",
             "description": "False when the chosen language has no translation and the English text is returned."
            },
            "links_to": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "slug": {
                "type": "string"
               },
               "term": {
                "type": "string",
                "description": "The English term."
               },
               "name": {
                "type": [
                 "string",
                 "null"
                ],
                "description": "The term's name in the chosen language, when it has one."
               },
               "description": {
                "type": "string"
               },
               "section": {
                "type": "object",
                "properties": {
                 "number": {
                  "type": "integer"
                 },
                 "title": {
                  "type": "string"
                 }
                },
                "required": [
                 "number",
                 "title"
                ]
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "slug",
               "term",
               "name",
               "description",
               "section",
               "url"
              ]
             }
            },
            "linked_from": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "slug": {
                "type": "string"
               },
               "term": {
                "type": "string",
                "description": "The English term."
               },
               "name": {
                "type": [
                 "string",
                 "null"
                ],
                "description": "The term's name in the chosen language, when it has one."
               },
               "description": {
                "type": "string"
               },
               "section": {
                "type": "object",
                "properties": {
                 "number": {
                  "type": "integer"
                 },
                 "title": {
                  "type": "string"
                 }
                },
                "required": [
                 "number",
                 "title"
                ]
               },
               "url": {
                "type": "string"
               }
              },
              "required": [
               "slug",
               "term",
               "name",
               "description",
               "section",
               "url"
              ]
             }
            },
            "data_url": {
             "type": "string",
             "description": "The same entry as a JSON file, in every language."
            },
            "markdown_url": {
             "type": "string",
             "description": "The same entry as a markdown file."
            },
            "learn_url": {
             "type": "string",
             "description": "The term in the Learn view, which teaches it step by step. Offer it when the user wants to study the term."
            },
            "map_url": {
             "type": "string",
             "description": "The term on the map of all terms, with its links drawn. Offer it when the user wants to see what it connects to."
            }
           },
           "required": [
            "slug",
            "term",
            "name",
            "description",
            "section",
            "url",
            "position",
            "body",
            "usage",
            "translated",
            "links_to",
            "linked_from",
            "data_url",
            "markdown_url",
            "learn_url",
            "map_url"
           ]
          },
          "suggestions": {
           "type": "array",
           "description": "Terms the caller may have meant. Retry with one of these slugs.",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term"
            ]
           }
          }
         },
         "required": [
          "found",
          "query"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/api/v1/get_section": {
   "get": {
    "operationId": "get_section",
    "summary": "List the terms of a section",
    "description": "The terms of one curriculum section, in teaching order, each with its description. Sections are numbered from 1; get_overview lists them. An unknown number comes back with found false and the sections that do exist. Use this to browse a part of the curriculum; use search when you have a question rather than a section.",
    "parameters": [
     {
      "name": "section",
      "in": "query",
      "required": true,
      "description": "The section's number, from get_overview.",
      "schema": {
       "type": "integer",
       "minimum": 1
      },
      "example": 2
     },
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in.",
      "schema": {
       "type": "string",
       "enum": [
        "vi",
        "en"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "section": {
           "type": "object",
           "properties": {
            "number": {
             "type": "integer"
            },
            "title": {
             "type": "string"
            }
           },
           "required": [
            "number",
            "title"
           ]
          },
          "terms": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string",
              "description": "The English term."
             },
             "name": {
              "type": [
               "string",
               "null"
              ],
              "description": "The term's name in the chosen language, when it has one."
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url"
            ]
           }
          },
          "sections": {
           "type": "array",
           "description": "The sections that exist. Present when found is false.",
           "items": {
            "type": "object",
            "properties": {
             "number": {
              "type": "integer"
             },
             "title": {
              "type": "string"
             }
            },
            "required": [
             "number",
             "title"
            ]
           }
          }
         },
         "required": [
          "found"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   },
   "post": {
    "operationId": "get_section_post",
    "summary": "List the terms of a section (POST)",
    "description": "The same call, with the parameters as a JSON object in the body.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "section": {
          "type": "integer",
          "minimum": 1,
          "description": "The section's number, from get_overview."
         },
         "lang": {
          "type": "string",
          "enum": [
           "vi",
           "en"
          ],
          "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in."
         }
        },
        "required": [
         "section"
        ]
       },
       "example": {
        "section": 2
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "section": {
           "type": "object",
           "properties": {
            "number": {
             "type": "integer"
            },
            "title": {
             "type": "string"
            }
           },
           "required": [
            "number",
            "title"
           ]
          },
          "terms": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string",
              "description": "The English term."
             },
             "name": {
              "type": [
               "string",
               "null"
              ],
              "description": "The term's name in the chosen language, when it has one."
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url"
            ]
           }
          },
          "sections": {
           "type": "array",
           "description": "The sections that exist. Present when found is false.",
           "items": {
            "type": "object",
            "properties": {
             "number": {
              "type": "integer"
             },
             "title": {
              "type": "string"
             }
            },
            "required": [
             "number",
             "title"
            ]
           }
          }
         },
         "required": [
          "found"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/api/v1/get_related": {
   "get": {
    "operationId": "get_related",
    "summary": "Terms linked to a term",
    "description": "The neighbours of a term in the link graph: the terms its entry links to, and the terms whose entries link to it, each with its description. It walks one step from a term you already have. Use this after get_term to widen an answer; use search when you have a question and no starting term. An unknown slug comes back with found false and suggestions.",
    "parameters": [
     {
      "name": "slug",
      "in": "query",
      "required": true,
      "description": "The term's slug, such as \"context-window\".",
      "schema": {
       "type": "string"
      },
      "example": "context-window"
     },
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in.",
      "schema": {
       "type": "string",
       "enum": [
        "vi",
        "en"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "query": {
           "type": "string"
          },
          "slug": {
           "type": "string"
          },
          "term": {
           "type": "string"
          },
          "links_to": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string",
              "description": "The English term."
             },
             "name": {
              "type": [
               "string",
               "null"
              ],
              "description": "The term's name in the chosen language, when it has one."
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url"
            ]
           }
          },
          "linked_from": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string",
              "description": "The English term."
             },
             "name": {
              "type": [
               "string",
               "null"
              ],
              "description": "The term's name in the chosen language, when it has one."
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url"
            ]
           }
          },
          "suggestions": {
           "type": "array",
           "description": "Terms the caller may have meant. Retry with one of these slugs.",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term"
            ]
           }
          }
         },
         "required": [
          "found",
          "query"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   },
   "post": {
    "operationId": "get_related_post",
    "summary": "Terms linked to a term (POST)",
    "description": "The same call, with the parameters as a JSON object in the body.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "slug": {
          "type": "string",
          "description": "The term's slug, such as \"context-window\"."
         },
         "lang": {
          "type": "string",
          "enum": [
           "vi",
           "en"
          ],
          "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in."
         }
        },
        "required": [
         "slug"
        ]
       },
       "example": {
        "slug": "context-window"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "found": {
           "type": "boolean"
          },
          "query": {
           "type": "string"
          },
          "slug": {
           "type": "string"
          },
          "term": {
           "type": "string"
          },
          "links_to": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string",
              "description": "The English term."
             },
             "name": {
              "type": [
               "string",
               "null"
              ],
              "description": "The term's name in the chosen language, when it has one."
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url"
            ]
           }
          },
          "linked_from": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string",
              "description": "The English term."
             },
             "name": {
              "type": [
               "string",
               "null"
              ],
              "description": "The term's name in the chosen language, when it has one."
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url"
            ]
           }
          },
          "suggestions": {
           "type": "array",
           "description": "Terms the caller may have meant. Retry with one of these slugs.",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term"
            ]
           }
          }
         },
         "required": [
          "found",
          "query"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  },
  "/api/v1/compare": {
   "get": {
    "operationId": "compare",
    "summary": "Compare terms",
    "description": "Two to 6 terms side by side: each one's description, body and section, whether they share a section, the links that run between them, and the terms that all of them link to. Use this when the question is \"X vs Y\" or \"how does X differ from Y\". Call search first if you only have names. An unknown slug lands in missing with suggestions, and the rest are still compared.",
    "parameters": [
     {
      "name": "slugs",
      "in": "query",
      "required": true,
      "description": "Slugs of the terms to compare, 2 to 6.",
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "minItems": 2,
       "maxItems": 6
      },
      "example": [
       "context",
       "context-window"
      ]
     },
     {
      "name": "lang",
      "in": "query",
      "required": false,
      "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in.",
      "schema": {
       "type": "string",
       "enum": [
        "vi",
        "en"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "terms": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             },
             "name": {
              "type": [
               "string",
               "null"
              ]
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             },
             "body": {
              "type": "string",
              "description": "Markdown."
             },
             "links_to": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url",
             "body",
             "links_to"
            ]
           }
          },
          "missing": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "query": {
              "type": "string"
             },
             "suggestions": {
              "type": "array",
              "description": "Terms the caller may have meant. Retry with one of these slugs.",
              "items": {
               "type": "object",
               "properties": {
                "slug": {
                 "type": "string"
                },
                "term": {
                 "type": "string"
                }
               },
               "required": [
                "slug",
                "term"
               ]
              }
             }
            },
            "required": [
             "query",
             "suggestions"
            ]
           }
          },
          "same_section": {
           "type": "boolean"
          },
          "links_between": {
           "type": "array",
           "description": "Each pair where the first term's entry links to the second.",
           "items": {
            "type": "object",
            "properties": {
             "from": {
              "type": "string"
             },
             "to": {
              "type": "string"
             }
            },
            "required": [
             "from",
             "to"
            ]
           }
          },
          "shared_links": {
           "type": "array",
           "description": "Terms that every compared term links to.",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term"
            ]
           }
          }
         },
         "required": [
          "terms",
          "missing",
          "same_section",
          "links_between",
          "shared_links"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   },
   "post": {
    "operationId": "compare_post",
    "summary": "Compare terms (POST)",
    "description": "The same call, with the parameters as a JSON object in the body.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "slugs": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "minItems": 2,
          "maxItems": 6,
          "description": "Slugs of the terms to compare, 2 to 6."
         },
         "lang": {
          "type": "string",
          "enum": [
           "vi",
           "en"
          ],
          "description": "Language of the text in the answer: \"vi\" (Vietnamese, the default) or \"en\" (English). Use the language the user writes in."
         }
        },
        "required": [
         "slugs"
        ]
       },
       "example": {
        "slugs": [
         "context",
         "context-window"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer of the tool.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "terms": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             },
             "name": {
              "type": [
               "string",
               "null"
              ]
             },
             "description": {
              "type": "string"
             },
             "section": {
              "type": "object",
              "properties": {
               "number": {
                "type": "integer"
               },
               "title": {
                "type": "string"
               }
              },
              "required": [
               "number",
               "title"
              ]
             },
             "url": {
              "type": "string"
             },
             "body": {
              "type": "string",
              "description": "Markdown."
             },
             "links_to": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            },
            "required": [
             "slug",
             "term",
             "name",
             "description",
             "section",
             "url",
             "body",
             "links_to"
            ]
           }
          },
          "missing": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "query": {
              "type": "string"
             },
             "suggestions": {
              "type": "array",
              "description": "Terms the caller may have meant. Retry with one of these slugs.",
              "items": {
               "type": "object",
               "properties": {
                "slug": {
                 "type": "string"
                },
                "term": {
                 "type": "string"
                }
               },
               "required": [
                "slug",
                "term"
               ]
              }
             }
            },
            "required": [
             "query",
             "suggestions"
            ]
           }
          },
          "same_section": {
           "type": "boolean"
          },
          "links_between": {
           "type": "array",
           "description": "Each pair where the first term's entry links to the second.",
           "items": {
            "type": "object",
            "properties": {
             "from": {
              "type": "string"
             },
             "to": {
              "type": "string"
             }
            },
            "required": [
             "from",
             "to"
            ]
           }
          },
          "shared_links": {
           "type": "array",
           "description": "Terms that every compared term links to.",
           "items": {
            "type": "object",
            "properties": {
             "slug": {
              "type": "string"
             },
             "term": {
              "type": "string"
             }
            },
            "required": [
             "slug",
             "term"
            ]
           }
          }
         },
         "required": [
          "terms",
          "missing",
          "same_section",
          "links_between",
          "shared_links"
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "429": {
      "$ref": "#/components/responses/TooManyRequests"
     },
     "503": {
      "$ref": "#/components/responses/Unavailable"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Problem": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      },
      "required": [
       "code",
       "message"
      ]
     },
     "docs": {
      "type": "string"
     }
    },
    "required": [
     "error"
    ]
   }
  },
  "responses": {
   "BadRequest": {
    "description": "A parameter is missing or wrong. The message says which.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "TooManyRequests": {
    "description": "Over the rate limit. Retry after the seconds in the Retry-After header.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "Unavailable": {
    "description": "The dictionary data could not be loaded. Try again shortly.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   }
  }
 }
}