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

# API

Polyglot provides both client-side and server-side APIs for chat management and synchronization.

## API Components

* [**Sync API**](https://github.com/ForestMars/Polyglot/blob/main/docs/api/api/sync-api.md) - Server REST endpoints for synchronization
* [**Client API**](https://github.com/ForestMars/Polyglot/blob/main/docs/api/api/client-api.md) - Browser-based chat operations
* [**Storage API**](https://github.com/ForestMars/Polyglot/blob/main/docs/api/api/storage-api.md) - IndexedDB abstraction layer
* [**Complete Reference**](https://github.com/ForestMars/Polyglot/blob/main/docs/api/api/api-reference.md) - All APIs in one document

## Quick Reference

### Client Storage Operations

```typescript
import { indexedDbStorage } from './src/services/indexedDbStorage';

// Basic operations
await indexedDbStorage.saveConversation(chat);
const chats = await indexedDbStorage.listConversations();
const chat = await indexedDbStorage.loadConversation(id);
await indexedDbStorage.deleteConversation(id);
```
