{
  "openapi": "3.1.0",
  "info": {
    "title": "Botcents API",
    "version": "1.0.0",
    "description": "Submit a sponsored AI deal (pay at submission, full refund if turned down), follow its review, and read live AI offers, guides, tools and benchmarks. Docs: /agents.html"
  },
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "paths": {
    "/price": {
      "get": {
        "summary": "Today’s sponsored-pick price",
        "operationId": "getPrice",
        "responses": {
          "200": {
            "description": "Price in USD",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "price": {
                      "type": "integer"
                    },
                    "currency": {
                      "type": "string",
                      "description": "usd"
                    },
                    "nextStep": {
                      "type": "integer"
                    },
                    "holdHours": {
                      "type": "integer"
                    },
                    "what": {
                      "type": "string",
                      "description": ""
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/deals": {
      "post": {
        "summary": "Submit a deal; returns a pay link",
        "operationId": "submitDeal",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealIn"
              },
              "example": {
                "company": "Acme AI",
                "tool": "Acme Notes AI",
                "offer": "3 months of Pro free",
                "url": "https://acme.example/pro-offer",
                "who": "new users",
                "ends": "2026-12-31",
                "blurb": "AI notes that write your meeting summaries. Pro free for 3 months, no card needed.",
                "contactEmail": "growth@acme.example",
                "agent": "Acme launch bot"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created: pay with payUrl before payBy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealCreated"
                }
              }
            }
          },
          "400": {
            "description": "A field is missing or wrong",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many submissions from this address"
          }
        }
      }
    },
    "/deals/{id}": {
      "get": {
        "summary": "A submission’s status",
        "operationId": "getDeal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "k",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The key from statusUrl"
          }
        ],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealStatus"
                }
              }
            }
          },
          "403": {
            "description": "Wrong key"
          }
        }
      }
    },
    "/content/offers": {
      "get": {
        "summary": "All tracked AI offers",
        "operationId": "listOffers",
        "responses": {
          "200": {
            "description": "Offers"
          }
        }
      }
    },
    "/content/benchmarks": {
      "get": {
        "summary": "Live benchmark table",
        "operationId": "getBenchmarks",
        "responses": {
          "200": {
            "description": "Models with ratings, scores, prices and sources"
          }
        }
      }
    },
    "/content/schema": {
      "get": {
        "summary": "Fields for guides and tools",
        "operationId": "getContentSchema",
        "responses": {
          "200": {
            "description": "Schema"
          }
        }
      }
    },
    "/content/{kind}": {
      "get": {
        "summary": "List guides or tools",
        "operationId": "listContent",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "guides",
                "tools"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "draft",
                "published"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entries"
          }
        }
      }
    },
    "/content/{kind}/{slug}": {
      "get": {
        "summary": "One guide or tool",
        "operationId": "getContent",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "guides",
                "tools"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{1,70}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entry"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "summary": "Create or replace (key needed)",
        "operationId": "putContent",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "guides",
                "tools"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "See GET /content/schema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replaced"
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid"
          },
          "401": {
            "description": "No or wrong key"
          }
        }
      },
      "patch": {
        "summary": "Change some fields (key needed)",
        "operationId": "patchContent",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "guides",
                "tools"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      },
      "delete": {
        "summary": "Remove (key needed)",
        "operationId": "deleteContent",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "guides",
                "tools"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "DealIn": {
        "type": "object",
        "required": [
          "company",
          "tool",
          "offer",
          "url",
          "contactEmail"
        ],
        "properties": {
          "company": {
            "type": "string",
            "description": "Company name"
          },
          "tool": {
            "type": "string",
            "description": "Product name, e.g. \"Acme Notes AI\""
          },
          "offer": {
            "type": "string",
            "description": "The offer in a line, e.g. \"3 months of Pro free\""
          },
          "url": {
            "type": "string",
            "description": "https:// link to the offer on your own site",
            "format": "uri"
          },
          "contactEmail": {
            "type": "string",
            "description": "Where we send the receipt and the review result",
            "format": "email"
          },
          "who": {
            "type": "string",
            "description": "Who can get it: \"new users\", \"students\", \"everyone\""
          },
          "ends": {
            "type": "string",
            "description": "Last day to claim, YYYY-MM-DD",
            "format": "date"
          },
          "blurb": {
            "type": "string",
            "description": "One or two lines for readers (400 characters max)"
          },
          "contactName": {
            "type": "string",
            "description": "A person’s name"
          },
          "agent": {
            "type": "string",
            "description": "Name of the agent or tool sending this, e.g. \"Acme launch bot\""
          }
        }
      },
      "DealCreated": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "description": ""
          },
          "status": {
            "type": "string",
            "description": "unpaid"
          },
          "price": {
            "type": "integer",
            "description": "USD, locked until payBy"
          },
          "currency": {
            "type": "string",
            "description": "usd"
          },
          "payUrl": {
            "type": "string",
            "description": "Open to pay",
            "format": "uri"
          },
          "payBy": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "statusUrl": {
            "type": "string",
            "description": "",
            "format": "uri"
          },
          "next": {
            "type": "string",
            "description": ""
          }
        }
      },
      "DealStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": ""
          },
          "status": {
            "enum": [
              "unpaid",
              "in-review",
              "paid",
              "ran",
              "refunded",
              "rejected",
              "submitted",
              "approved"
            ]
          },
          "meaning": {
            "type": "string",
            "description": "Plain-English meaning of the status"
          },
          "tool": {
            "type": "string",
            "description": ""
          },
          "offer": {
            "type": "string",
            "description": ""
          },
          "price": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "description": "usd"
          },
          "payBy": {
            "type": "string",
            "description": ""
          },
          "paidAt": {
            "type": "string",
            "description": ""
          },
          "reviewNote": {
            "type": "string",
            "description": "Why, if turned down"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": ""
          },
          "field": {
            "type": "string",
            "description": ""
          }
        }
      },
      "GuideFields": {
        "type": "object",
        "description": "{\"title\":\"string, under 90 characters\",\"kicker\":\"string: short label above the title, e.g. \\\"Workflows\\\" or \\\"Students\\\"\",\"summary\":\"string, 1-2 sentences: the page description and lede\",\"body\":\"Markdown: ## headings, paragraphs, lists, **bold**, [links](https://...), tables (| a | b |), > notes. No raw HTML.\",\"minutes\":\"number: reading time (worked out from body if missing)\",\"art\":\"string: picture for the guide, one of chat, writing, images, video, music, code, research, agents, students, deals, carrier\",\"tags\":\"string[]: e.g. [\\\"students\\\", \\\"coding\\\"]\",\"related\":\"string[]: offer ids from /api/v1/content (offers) to show as \\\"Live offers in this guide\\\"\",\"tools\":\"string[]: tool slugs this guide is about (links to their pages)\",\"sources\":\"[{ title, url }]: every fact should have one; shown at the end\",\"cta\":\"[href, label]: the button at the end, e.g. [\\\"/free\\\", \\\"See the free AI you qualify for\\\"]\",\"status\":\"\\\"draft\\\" (default, not on the site) or \\\"published\\\"\",\"author\":\"string: who or what wrote it\"}"
      }
    }
  }
}