Collections

Create a document collection that OpenIndex.ai will index and calculate embeddings for.

Retrieve user collections.

get
Authorizations
Responses
200
A list of collections.
application/json
get
GET /api/collections HTTP/1.1
Host: www.openindex.ai
Authorization: Bearer JWT
Accept: */*
200

A list of collections.

{
  "ok": true,
  "collections": [
    {
      "id": "text",
      "slug": "text",
      "userId": "text",
      "active": true,
      "createdAt": 1,
      "updatedAt": 1,
      "name": "text",
      "description": "text",
      "image": "text",
      "privacy": "public",
      "namespace": "text",
      "sources": [],
      "status": "text"
    }
  ]
}

Create or update a collection.

post
Authorizations
Body
idstringOptional
namestringOptional
descriptionstringOptional
imagestringOptional
privacystring · enumOptionalPossible values:
knowledgeBasestringOptional

A list of URLs (one per row) to add to the collection. YouTube URLs will be transcripted. Use links(url) to index the direct links at url.

Responses
200
The result of the collection creation or update.
application/json
post
POST /api/collections HTTP/1.1
Host: www.openindex.ai
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 105

{
  "id": "text",
  "name": "text",
  "description": "text",
  "image": "text",
  "privacy": "public",
  "knowledgeBase": "text"
}
{
  "ok": true,
  "collectionId": "text"
}

List publicly-accessible URLs, one per line, in the knowledgeBase parameter. Any YouTube URL will be transcribed and index.

Use links(<url>) to index all direct links in url.

get
Authorizations
Query parameters
qstringRequired

The query to search for.

limitintegerOptional

The number of results to return.

collection_idstringOptional

You can restrict the search to a specific collection by passing its ID.

Responses
200
A list of collections.
application/json
get
GET /api/collections/search HTTP/1.1
Host: www.openindex.ai
Authorization: Bearer JWT
Accept: */*
200

A list of collections.

{
  "ok": true,
  "results": [
    {
      "snippet": "text",
      "url": "text",
      "sourceId": "text",
      "source": "web",
      "collection": {
        "id": "text",
        "slug": "text",
        "userId": "text",
        "active": true,
        "createdAt": 1,
        "updatedAt": 1,
        "name": "text",
        "description": "text",
        "image": "text",
        "privacy": "public",
        "namespace": "text",
        "sources": [],
        "status": "text"
      },
      "score": 1
    }
  ]
}

The /collections/search endpoint will run a hybrid similarity search of your query passed as parameter q and return the chunks and collections with the highest semantic similarity after a re-ranking step.

This endpoint can be used as an action in your custom OpenAI GPTs. Search the full OpenIndex.ai knowledge base by adding a new function to your custom GPT with this OpenAPI json schema.

If you want to only search a specific collection in your custom GPT, use the json schema URL https://www.openindex.ai/actions/gpt?collection_id=<collection_id>. We now show that URL in the main collection page, see for example the collection Vitalik's Essays.

For now only public OpenIndex.ai collections can be retrieved. We are looking to implement OAuth login with OpenAI GPT to also allow for private and team collections search.

Last updated