{
  "openapi": "3.1.0",
  "info": {
    "title": "Vrbose API",
    "version": "1.0.0",
    "description": "Low-latency prompt compression API for reducing LLM input token costs."
  },
  "servers": [
    {
      "url": "https://vrbose.ai"
    }
  ],
  "paths": {
    "/detokenate": {
      "post": {
        "summary": "Compress a query with the latest API revision.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["q"],
                "properties": {
                  "q": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64000
                  }
                }
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Compressed query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetokenateResponse"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/detokenate/v1": {
      "post": {
        "summary": "Compress a query with API revision v1.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "$ref": "#/paths/~1detokenate/post/requestBody"
        },
        "responses": {
          "$ref": "#/paths/~1detokenate/post/responses"
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "DetokenateResponse": {
        "type": "object",
        "required": ["q", "usage"],
        "properties": {
          "q": {
            "type": "string"
          },
          "usage": {
            "type": "object",
            "required": [
              "original_tokens_estimate",
              "compressed_tokens_estimate",
              "estimated_savings_percent"
            ],
            "properties": {
              "original_tokens_estimate": {
                "type": "integer"
              },
              "compressed_tokens_estimate": {
                "type": "integer"
              },
              "estimated_savings_percent": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "JSON error response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
