{
  "openapi": "3.1.0",
  "info": {
    "title": "Cloudkart.ai Developer API",
    "version": "1.0.0",
    "description": "Read-only JSON API over the Cloudkart.ai AI-tools catalog. Every tool is independently scored on a 5-point rubric; no pay-to-rank. Free without a key (per-IP rate limit); add an API key (Authorization: Bearer or X-API-Key) for higher limits and usage metering.",
    "contact": {
      "url": "https://cloudkart.ai/developers"
    }
  },
  "servers": [
    {
      "url": "https://cloudkart.ai"
    }
  ],
  "security": [
    {},
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "summary": "List published tools",
        "operationId": "listTools",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by category slug"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of tools",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolList"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v1/tools/{slug}": {
      "get": {
        "summary": "Get one tool by slug",
        "operationId": "getTool",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tool"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v1/categories": {
      "get": {
        "summary": "List catalog categories",
        "operationId": "listCategories",
        "responses": {
          "200": {
            "description": "Categories",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryList"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v1/badge/{slug}": {
      "get": {
        "summary": "Embeddable SVG score badge",
        "operationId": "getBadge",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SVG badge",
            "content": {
              "image/svg+xml": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer ck_live_..."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "IndiaFlags": {
        "type": "object",
        "description": "India-context attributes. Each is a boolean; absent/unknown is reported as false, never inferred.",
        "properties": {
          "inrPricing": {
            "type": "boolean"
          },
          "upi": {
            "type": "boolean"
          },
          "gstInvoicing": {
            "type": "boolean"
          },
          "dataResidency": {
            "type": "boolean"
          },
          "localSupport": {
            "type": "boolean"
          }
        }
      },
      "Rubric": {
        "type": [
          "object",
          "null"
        ],
        "description": "Current per-dimension scores (1-5), camelCase keys, derived from the Trust Graph.",
        "additionalProperties": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "ToolSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "pricing": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": [
              "number",
              "null"
            ],
            "description": "Cloudkart Score (1-5)"
          },
          "rubric": {
            "$ref": "#/components/schemas/Rubric"
          },
          "india": {
            "$ref": "#/components/schemas/IndiaFlags"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "Category slug"
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        }
      },
      "Tool": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "pricing": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": [
              "number",
              "null"
            ],
            "description": "Cloudkart Score (1-5)"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "rubric": {
            "$ref": "#/components/schemas/Rubric"
          },
          "trustGraph": {
            "type": [
              "object",
              "null"
            ],
            "description": "Versioned, provenanced scoring. score = weighted composite (Outcome counts 2x for agents); dimensions = latest non-superseded event per dimension.",
            "properties": {
              "score": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "asOf": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "dimensions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dimension": {
                      "type": "string",
                      "description": "actual_utility | ease_of_use | pricing_fairness | reliability | differentiation | outcome"
                    },
                    "value": {
                      "type": "number"
                    },
                    "weight": {
                      "type": "number"
                    },
                    "method": {
                      "type": "string",
                      "description": "editorial | benchmark | community"
                    },
                    "scoredAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "source": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "india": {
            "$ref": "#/components/schemas/IndiaFlags"
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        }
      },
      "ToolList": {
        "type": "object",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolSummary"
            }
          },
          "count": {
            "type": "integer",
            "description": "Tools in this page"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer",
            "description": "Total tools matching the filter, across all pages"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True when more pages remain (offset+count < total)"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        }
      },
      "CategoryList": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      }
    }
  }
}
