# Quickstart

**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: 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://docs.activeloop.ai/setup/quickstart.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.
