{
  "openapi": "3.1.0",
  "info": {
    "title": "Agentrial guest tools",
    "version": "1.0.0",
    "description": "Discover available tools and run a task without a vendor account."
  },
  "servers": [
    {
      "url": "https://agentrial.vercel.app"
    }
  ],
  "paths": {
    "/tools.json": {
      "get": {
        "operationId": "listAgentrialTools",
        "summary": "List available guest tools, example inputs, and output formats",
        "responses": {
          "200": {
            "description": "JSON tool directory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "example_input": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/run": {
      "post": {
        "operationId": "runAgentrialTool",
        "summary": "Run an Agentrial tool and return the file contents",
        "parameters": [
          {
            "name": "X-Trial-Guest",
            "in": "header",
            "required": true,
            "description": "Generate a UUID per user and reuse it across requests.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tool",
                  "input"
                ],
                "properties": {
                  "tool": {
                    "type": "string",
                    "enum": [
                      "sheet",
                      "captions"
                    ]
                  },
                  "input": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 16000
                  }
                }
              },
              "examples": {
                "sheet": {
                  "value": {
                    "tool": "sheet",
                    "input": "channel,spend,orders\nSearch,120,8\nVideo,90,3\nBrand,60,6"
                  }
                },
                "captions": {
                  "value": {
                    "tool": "captions",
                    "input": "0 | 2.4 | Welcome to the workshop.\n2.4 | 5.8 | Let’s make this easier.\n5.8 | 9.1 | Open your first project."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result ready",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "filename",
                    "media_type",
                    "content"
                  ],
                  "properties": {
                    "filename": {
                      "type": "string"
                    },
                    "media_type": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string",
                      "description": "File contents to save using UTF-8."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
