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

# Introduction

Here you'll find all the documentation you need to get up and running with the Knowbase.ai API.

### Base URL

```
https://api.knowbase.ai/api/v1
```

### Authentication

All API requests require a Bearer token in the `Authorization` header:

```
Authorization: Bearer YOUR_API_TOKEN
```

You can generate your API token from Account Settings in the Knowbase.ai web app, or via the `GET /api/v1/token` endpoint. API access requires a **Pro** or **Team** plan.

### Features

* **File Management** -- Upload, list, get details, delete, and retrieve summaries for documents
* **Collections** -- Group files into named collections for organized querying
* **Chat (Q\&A)** -- Ask questions against your documents with AI-powered answers and source citations
* **Streaming** -- Real-time Server-Sent Events (SSE) streaming for chat responses
* **Thinking Mode** -- Advanced multi-step reasoning for complex questions (Pro and Team)
* **Conversations** -- Persistent chat history with follow-up question support
* **Account Info** -- Check your plan, quotas, and usage

### Supported File Types

* **Documents**: PDF, DOCX, DOC, TXT, MD, PPTX, PPT
* **Audio**: MP3, WAV, M4A, AAC, OGG, FLAC
* **Video**: MP4, MOV, WEBM, AVI, MKV

### Limits

|                 | Pro            | Team           |
| --------------- | -------------- | -------------- |
| **Upload size** | 100 MB         | 100 MB         |
| **Rate limit**  | 20/min, 200/hr | 60/min, 600/hr |
| **Queries**     | 2,000/month    | 5,000/month    |
| **Storage**     | 25 GB          | 100 GB         |
| **Uploads**     | 500            | Unlimited      |

### Error Format

All errors return a consistent JSON format:

```json
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human readable description"
  }
}
```

Common error codes: `INVALID_TOKEN`, `EXPIRED_TOKEN`, `FORBIDDEN`, `NOT_FOUND`, `RATE_LIMIT`, `QUOTA_EXCEEDED`, `INVALID_REQUEST`, `FILE_TOO_LARGE`, `UNSUPPORTED_FILE_TYPE`, `INTERNAL_ERROR`.

### Interactive Docs

Explore and test all endpoints in the interactive Swagger UI:

```
https://api.knowbase.ai/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 dynamically by asking a question.

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

```
GET https://docs.knowbase.ai/api-reference/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
