> ## Documentation Index
> Fetch the complete documentation index at: https://docs.andoria.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Welcome to the Andoria API (For Clipboard Only)

Welcome to the Andoria API- The Andoria API is accessible through our main query endpoint at:

```json theme={null}
https://api.andoria.ai/query
```

## Query Parameters

Andoria Takes in the following query parameters

<ParamField path="query" type="string" required="true">
  The query you want to request Andoria with
</ParamField>

<ParamField path="messages" type="ChatMessage[]">
  The previous messages of the conversation. This is optional, and if not provided, the andoria API will be unable to recount previous elements of the conversation. The ChatMessage type is defined below.

  ```ts theme={null}
  type ChatMessage = {
    role : "user" | "asistant",
    content  : string // this is the content of the message
  }
  ```
</ParamField>

<ParamField path="stream" type="boolean">
  Whether you want to stream the result. If not provided, will default to false.
</ParamField>

## Response Parameters

<ParamField path="answer" type="string">
  The main Andoria response
</ParamField>

<ParamField path="source_excerpts" type="AndoriaSourceExcerpt[]">
  A list of all of the sources Andoria used to generate the answer. The AndoriaSourceExcerpt type is defined below.

  ```ts theme={null}
  type AndoriaSourceExcerpt = {
    source_path : string
    title  : string 
  }
  ```
</ParamField>

## Sample Queries

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.andoria.ai/query \
    -H "Content-Type: application/json" \
    -d '{"query": "I can'\''t log in to my shifts", "stream": true}' \
    --no-buffer
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.andoria.ai/query \
    -H "Content-Type: application/json" \
    -d '{"query": "I can'\''t log in to my shifts", "stream": false}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.andoria.ai/query', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      query: 'Your query here',
      stream: true
    })
  });

  const reader = response.body.getReader();
  const decoder = new TextDecoder();

  while (true) {
    const { done, value } = await reader.read();
    if (done) break;
    
    const chunk = decoder.decode(value);
    console.log(chunk); // Process your streamed data - here we are just logging it
  }
  ```
</CodeGroup>
