OpenIndex.ai

OpenIndex.ai · GPT-Aktionen

OpenIndex.ai API

Search the knowledge base contributed to OpenIndex.ai

  • GET /collections/searchSearch collections
Ursprüngliches API-Schema
{
  "openapi": "3.0.0",
  "info": {
    "version": "0.1.0",
    "title": "OpenIndex.ai API",
    "description": "Search the knowledge base contributed to OpenIndex.ai"
  },
  "servers": [
    {
      "url": "https://www.openindex.ai/api"
    }
  ],
  "paths": {
    "/collections/search": {
      "get": {
        "summary": "Search collections",
        "operationId": "search",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The query to search for."
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "The number of results to return."
          }
        ],
        "responses": {
          "200": {
            "description": "A list of chunks from collections.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "collections": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Collection"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Source": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "embedded": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "lastIndexed": {
            "type": "integer"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "web",
              "upload"
            ]
          },
          "url": {
            "type": "string"
          }
        }
      },
      "Privacy": {
        "type": "string",
        "enum": [
          "public",
          "private",
          "team"
        ]
      },
      "Collection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "image": {
            "type": "string"
          },
          "privacy": {
            "$ref": "#/components/schemas/Privacy"
          },
          "namespace": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#components/schemas/Source"
            }
          },
          "status": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}