{
  "openapi": "3.1.0",
  "info": {
    "title": "cosentino.me API",
    "version": "1.0.0",
    "summary": "Read-only API for Luca Cosentino's profile, essays, projects and beliefs.",
    "description": "Public, read-only and free. No sign-up, no API key. Every endpoint is a GET that never changes data, so the production API is also a safe sandbox.\n\nVersioning: the major version is in the path (/v1). Breaking changes ship as /v2; /v1 then answers with Deprecation and Sunset headers for at least 90 days. Additive changes (new fields, new endpoints) can happen within v1.\n\nErrors are RFC 9457 problem+json with a machine-readable `code` and a `hint`. Rate limit: 600 requests per minute per client, announced in RateLimit / RateLimit-Policy headers; over the limit you get 429 with Retry-After.\n\nAlso available: an MCP server at https://cosentino.me/mcp, NLWeb at https://cosentino.me/ask, an A2A agent at https://cosentino.me/a2a. Docs: https://cosentino.me/developers/",
    "contact": {
      "name": "Luca Cosentino",
      "url": "https://cosentino.me/contact/"
    },
    "license": {
      "name": "Content © Luca Cosentino; quote with attribution",
      "url": "https://cosentino.me/privacy/"
    }
  },
  "externalDocs": {
    "description": "Developer docs",
    "url": "https://cosentino.me/developers/"
  },
  "servers": [
    {
      "url": "https://cosentino.me/api/v1",
      "description": "Production (read-only; also the sandbox)"
    }
  ],
  "tags": [
    {
      "name": "profile"
    },
    {
      "name": "writing"
    },
    {
      "name": "projects"
    },
    {
      "name": "search"
    }
  ],
  "paths": {
    "/profile": {
      "get": {
        "operationId": "getProfile",
        "tags": [
          "profile"
        ],
        "summary": "Get the profile",
        "description": "Current role, teaching, career history, education, topics and links.",
        "responses": {
          "200": {
            "description": "The profile.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for Retry-After seconds.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/essays": {
      "get": {
        "operationId": "listEssays",
        "tags": [
          "writing"
        ],
        "summary": "List essays",
        "description": "Essays from writing.cosentino.me, newest first. Cursor pagination.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "Only essays in this topic.",
            "schema": {
              "type": "string",
              "enum": [
                "business",
                "life",
                "books"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size (1-50, default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from a previous `next_cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of essays.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EssayPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for Retry-After seconds.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/essays/{id}": {
      "get": {
        "operationId": "getEssay",
        "tags": [
          "writing"
        ],
        "summary": "Get one essay",
        "description": "One essay by id (its URL slug).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Essay id (URL slug).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The essay.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essay"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No essay with that id.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for Retry-After seconds.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/projects": {
      "get": {
        "operationId": "listProjects",
        "tags": [
          "projects"
        ],
        "summary": "List projects",
        "description": "Software projects with live demo and source links.",
        "responses": {
          "200": {
            "description": "All projects.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Project"
                      }
                    }
                  },
                  "required": [
                    "projects"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for Retry-After seconds.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/beliefs": {
      "get": {
        "operationId": "listBeliefs",
        "tags": [
          "profile"
        ],
        "summary": "List beliefs",
        "description": "The principles under \"some things i believe\", with supporting points.",
        "responses": {
          "200": {
            "description": "All beliefs.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "beliefs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Belief"
                      }
                    }
                  },
                  "required": [
                    "beliefs"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for Retry-After seconds.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchSite",
        "tags": [
          "search"
        ],
        "summary": "Search the site",
        "description": "Full-text search over bio, essays, projects and beliefs. Ranked, cursor pagination.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Query, 1-200 characters.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size (1-20, default 5).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from a previous `next_cursor`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked results.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait for Retry-After seconds.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RateLimit": {
        "description": "Remaining quota (draft-ietf-httpapi-ratelimit-headers), e.g. `\"default\";r=599;t=42`.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitPolicy": {
        "description": "Quota policy, e.g. `\"default\";q=600;w=60`.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Profile": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "job_title": {
            "type": "string"
          },
          "works_for": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          },
          "teaches": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "course": {
                "type": "string"
              }
            }
          },
          "education": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "location": {
            "type": "string"
          },
          "nationality": {
            "type": "string"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bio": {
            "type": "object",
            "properties": {
              "currently": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "previously": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "background": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "updated": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "name",
          "summary",
          "job_title",
          "works_for",
          "links"
        ]
      },
      "Essay": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "topic": {
            "type": "string",
            "enum": [
              "business",
              "life",
              "books"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "title",
          "url",
          "date",
          "topic"
        ]
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "repository": {
            "type": "string",
            "format": "uri"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "url"
        ]
      },
      "Belief": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "points": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "title",
          "points"
        ]
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "profile",
              "essay",
              "project",
              "belief"
            ]
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "snippet": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "type",
          "id",
          "title",
          "url",
          "snippet",
          "score"
        ]
      },
      "EssayPage": {
        "type": "object",
        "properties": {
          "essays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Essay"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to get the next page; null on the last page."
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "essays",
          "next_cursor",
          "has_more"
        ]
      },
      "SearchPage": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "query",
          "results",
          "next_cursor",
          "has_more"
        ]
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details.",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code, e.g. not_found, invalid_parameter, rate_limited."
          },
          "hint": {
            "type": "string",
            "description": "What to do next."
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code"
        ]
      }
    }
  }
}
