> For the complete documentation index, see [llms.txt](https://docs.activeloop.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.activeloop.ai/setup/quickstart.md).

# Quickstart

Upload a document and run a query. All within minutes.

**Get Token**

Sign up at [chat.activeloop.ai](http://chat.activeloop.ai). Navigate to ⚙️ → API tokens, and create a token. Set the token as `ACTIVELOOP_TOKEN` environment variable.

**Upload Documents**

We will fetch 4 reference guides from NASA each more than 90 pages and ask a highly complex question.&#x20;

```python
import os, io, requests

pdf_urls = ["https://www.nasa.gov/wp-content/uploads/2022/03/sls-reference-guide-2022-v2-508-0.pdf",
            "https://www.nasa.gov/wp-content/uploads/2023/02/orion-reference-guide-111022.pdf", 
            "https://www.lpi.usra.edu/lunar/artemis/Artemis-I-Reference-Guide_NP-2022-03-3045-HQ.pdf",
            "https://www.ulalaunch.com/docs/default-source/rockets/2023_vulcan_user_guide.pdf"]

files = [('file', (os.path.basename(url), io.BytesIO(requests.get(url).content))) for url in pdf_urls]

response = requests.post(
      'https://api.activeloop.ai/files', 
      headers={"Authorization": f"Bearer {os.getenv('ACTIVELOOP_TOKEN')}"},
      files=files
)
# Onced uploaded, it would take few minutes to index
```

You can learn about the state by [listing files](/api-reference/files.md).

**Query Data**

Once the data is indexed, you can run a query against it as if you are calling your LLM . &#x20;

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.activeloop.ai/",
    api_key=os.getenv('ACTIVELOOP_TOKEN')
)

response = client.chat.completions.create(
    model="activeloop-l0",
    messages=[
        {
            "role": "user",
            "content": "Using the side-view diagrams that annotate overall height, rank SLS Block 1, Orion (CM + SM), " +
                       "Falcon 9 (v1.2 FT), and Vulcan Centaur by height; which vehicle is the second tallest, " +
                       "and what is its annotated height (m, one decimal place)?"
        }
    ],
    stream=True
)

chunks = [chunk.choices[0] for chunk in response]
thinking = "".join([c.delta.reasoning_content for c in chunks if c.delta.reasoning_content is not None]) 
answer = "".join([c.delta.content for c in chunks if c.delta.content is not None]) 
citations = chunks[-1].metadata['relevant_docs']

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.activeloop.ai/setup/quickstart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
