{
  "openapi": "3.1.0",
  "info": {
    "title": "LUBLU public catalog",
    "version": "1.0.0",
    "description": "Read-only companion catalog for directories and agents. Chat is not a public API — people open chat_url in a browser.",
    "contact": {
      "email": "hi@lublu.ai"
    }
  },
  "servers": [
    {
      "url": "https://lublu.ai"
    }
  ],
  "paths": {
    "/api/v1/companions": {
      "get": {
        "summary": "List companions",
        "operationId": "listCompanions",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by name, gender, city or description"
          },
          {
            "name": "aff",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Partner tag: profile_url and chat_url in the response then carry it (https://lublu.ai/affiliates)"
          },
          {
            "name": "s1",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Partner sub id, carried on the links next to aff"
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/companions/{id}": {
      "get": {
        "summary": "One companion",
        "operationId": "getCompanion",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Companion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Companion"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Catalog": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "companions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Companion"
            }
          }
        }
      },
      "Companion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "tagline": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "thumbnail": {
            "type": "string",
            "format": "uri"
          },
          "profile_url": {
            "type": "string",
            "format": "uri"
          },
          "chat_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
