Quick Start

Good to know: Run your generative app on OpenIndex.ai APIs, including your RAG (retrieval-augmented generation) architecture, document embeddings and tools/plugins.

Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can generate one or more API keys from your Dashboard.

Make your first request

Let's first create a document collection. OpenIndex.ai will index the documents and calculate embeddings for future retrieval augmented generation (i.e. Q&A with documents).

curl -X POST 'https://www.openindex.ai/api/collections' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <your api key>' \
  -d '{
    "name": "My test collection",
    "description": "My first OpenIndex.ai collection",
    "knowledgeBase": "http://www.paulgraham.com/greatwork.html\nhttps://www.youtube.com/watch?v=MqS_GIbXboc"
  }'

The call above will return a collectionId in its json response if it succeeds. Use that parameter to ask questions to the document. First wait a minute to allow our backend to crawl, index and embed the documents.

curl -X POST 'https://www.openindex.ai/api/chat' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <your api key>' \
  -d '{
    "collectionId": "<collectionId returned above>",
    "message": "How does Paul Graham define great work?",
    "streaming": false,
  }'

Last updated