{
  "openapi": "3.1.0",
  "info": {
    "title": "カギバコ generator API",
    "version": "1.0.0",
    "description": "Generates passwords, passphrases and identifiers. Values are generated server-side and travel over the network: intended for throwaway test data, CI fixtures and scratch accounts, not for production credentials. Generate those locally instead (see /en/cli/).",
    "license": {
      "name": "Free to use",
      "url": "https://kagi.mediabako.com/about/"
    }
  },
  "servers": [
    {
      "url": "https://kagi.mediabako.com"
    }
  ],
  "paths": {
    "/api/password": {
      "get": {
        "operationId": "generatePassword",
        "summary": "Generate one or more random passwords",
        "parameters": [
          {
            "name": "len",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 4,
              "maximum": 128,
              "default": 20
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 1
            }
          },
          {
            "name": "upper",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 1
            }
          },
          {
            "name": "lower",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 1
            }
          },
          {
            "name": "digits",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 1
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "urlsafe",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "ambiguous",
            "in": "query",
            "description": "1 excludes look-alike characters (0 O 1 l I |)",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "plain",
                "json"
              ],
              "default": "plain"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One password per line (plain) or a JSON object",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "bits": {
                      "type": "number",
                      "description": "log2(charset^length)"
                    },
                    "charsetSize": {
                      "type": "integer"
                    },
                    "advisory": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/passphrase": {
      "get": {
        "operationId": "generatePassphrase",
        "summary": "Generate passphrases from the EFF long wordlist (12.925 bits per word)",
        "parameters": [
          {
            "name": "words",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 3,
              "maximum": 12,
              "default": 6
            }
          },
          {
            "name": "sep",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "-",
              "maxLength": 4
            }
          },
          {
            "name": "capitalize",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            }
          },
          {
            "name": "digits",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4,
              "default": 0
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "plain",
                "json"
              ],
              "default": "plain"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One passphrase per line (plain) or a JSON object"
          }
        }
      }
    },
    "/api/uuid": {
      "get": {
        "operationId": "generateIdentifier",
        "summary": "Generate UUID v4, time-ordered UUID v7, or ULID",
        "parameters": [
          {
            "name": "v",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "4",
                "7",
                "ulid"
              ],
              "default": "4"
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "plain",
                "json"
              ],
              "default": "plain"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One identifier per line (plain) or a JSON object"
          }
        }
      }
    }
  }
}
