openapi: 3.1.0
info:
  title: quik.space MCP API
  version: "1.0.0"
  description: >
    Programmatic file sharing for AI agents. The live endpoint is MCP over
    JSON-RPC 2.0 at https://quik.space/mcp. Free upload and lookup calls need
    no authentication. Paid actions return an x402 payment requirement and are
    retried with X-Payment-Proof.
servers:
  - url: https://quik.space
paths:
  /mcp:
    post:
      operationId: callMcpTool
      summary: Call the quik.space MCP endpoint
      description: >
        Send JSON-RPC 2.0 requests for initialize, tools/list, and tools/call.
        Tool names are quik.upload, quik.get_file_info, and quik.extend_file.
      parameters:
        - in: header
          name: X-Payment-Proof
          required: false
          schema:
            type: string
          description: Opaque x402 proof returned by an agent after signing the payment requirement.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/InitializeRequest"
                - $ref: "#/components/schemas/ToolsListRequest"
                - $ref: "#/components/schemas/ToolsCallRequest"
            examples:
              listTools:
                summary: List tools
                value:
                  jsonrpc: "2.0"
                  id: 1
                  method: tools/list
              upload:
                summary: Upload a small file
                value:
                  jsonrpc: "2.0"
                  id: 2
                  method: tools/call
                  params:
                    name: quik.upload
                    arguments:
                      filename: notes.md
                      content_base64: IyBoZWxsbwo=
                      content_type: text/markdown
              getInfo:
                summary: Get file info
                value:
                  jsonrpc: "2.0"
                  id: 3
                  method: tools/call
                  params:
                    name: quik.get_file_info
                    arguments:
                      share_url_or_id: abc12345
              extend:
                summary: Extend a file after x402 payment
                value:
                  jsonrpc: "2.0"
                  id: 4
                  method: tools/call
                  params:
                    name: quik.extend_file
                    arguments:
                      share_url_or_id: abc12345
      responses:
        "200":
          description: JSON-RPC response. Tool errors are returned as JSON-RPC results with isError when appropriate.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JsonRpcResponse"
        "402":
          description: Payment required for paid action.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/X402Requirement"
components:
  schemas:
    InitializeRequest:
      type: object
      required: [jsonrpc, method]
      properties:
        jsonrpc:
          const: "2.0"
        id:
          oneOf:
            - type: string
            - type: number
            - type: "null"
        method:
          const: initialize
        params:
          type: object
    ToolsListRequest:
      type: object
      required: [jsonrpc, method]
      properties:
        jsonrpc:
          const: "2.0"
        id:
          oneOf:
            - type: string
            - type: number
            - type: "null"
        method:
          const: tools/list
    ToolsCallRequest:
      type: object
      required: [jsonrpc, method, params]
      properties:
        jsonrpc:
          const: "2.0"
        id:
          oneOf:
            - type: string
            - type: number
            - type: "null"
        method:
          const: tools/call
        params:
          type: object
          required: [name, arguments]
          properties:
            name:
              type: string
              enum: [quik.upload, quik.get_file_info, quik.extend_file]
            arguments:
              type: object
    JsonRpcResponse:
      type: object
      properties:
        jsonrpc:
          const: "2.0"
        id:
          oneOf:
            - type: string
            - type: number
            - type: "null"
        result:
          type: object
        error:
          type: object
    X402Requirement:
      type: object
      description: x402 payment requirement returned before paid actions.
      additionalProperties: true
