# Collections

{% openapi src="<https://www.openindex.ai/index.yaml>" path="/collections" method="get" %}
<https://www.openindex.ai/index.yaml>
{% endopenapi %}

{% openapi src="<https://www.openindex.ai/index.yaml>" path="/collections" method="post" %}
<https://www.openindex.ai/index.yaml>
{% endopenapi %}

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`.

{% openapi src="<https://www.openindex.ai/index.yaml>" path="/collections/search" method="get" %}
<https://www.openindex.ai/index.yaml>
{% endopenapi %}

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](https://www.openindex.ai/.well-known/gptaction.json).

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](https://www.openindex.ai/collection/9lo9KTEbcFUD49pZtQmv).&#x20;

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://openindexai.gitbook.io/openindex.ai-api-documentation-1/reference/api-reference/collections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
