# Build on your Anki collection

Ankinize is a sync server for Anki with a REST API on top of the same collection. Use it to keep your devices in step, to add cards from your own tools, or to read your decks from an app you are writing.

[Sync with AnkiPoint Anki on your computer or phone at Ankinize and keep every device in step.Read](https://ankinize.com/docs/sync)[AuthenticationPasswords, passkeys, two-factor and API keys, and which one to use where.Read](https://ankinize.com/docs/authentication)[API referenceRead and change decks, notes, note types and cards over HTTP, with runnable examples.Read](https://ankinize.com/docs/api)[TypeScript SDKCall the API from TypeScript with typed functions, no setup beyond a key.Read](https://ankinize.com/docs/sdk)

## How it fits together

Every account has one **Collection**: your decks, notes, cards and scheduling, plus the **Media Files** (images and audio) that go with them. There are two ways to reach it, and both work on the same data.

|   | Anki sync | REST API |
| --- | --- | --- |
| Used by | Anki on desktop, Android and iOS | Your scripts, apps and automations |
| Speaks | Anki's own sync protocol | JSON over HTTPS |
| Signs in with | Email and password, or a sync API key | An API key (Bearer) |
| Address | `https://ankinize.com/` | `https://ankinize.com/api/v1` |

A note you add through the API appears in Anki on its next sync, and a note you add in Anki is there when you read it through the API. While Anki is syncing, the API waits its turn: a write during a sync is answered `423 Locked` with a `Retry-After` header, and retrying is always safe.

## Quickstart

1. Create an account and verify your email
   
   Sign up, then follow the link in the verification email. Syncing and API keys stay switched off until the address is verified.
2. Connect Anki
   
   In Anki, open *Preferences → Syncing* and set the self-hosted sync server to:
   
   Sync server
   
   ```
   https://ankinize.com/
   ```
   
   Then press Sync and log in with your email and password. The [sync guide](https://ankinize.com/docs/sync) has the steps for AnkiDroid and AnkiMobile too.
3. Create an API key (optional)
   
   Under *API Keys & Devices* in the dashboard, create a key with the `read` scope. Copy it when it is shown: it is never shown again.
4. Make your first request
   
   ```
   # Keep the key in an environment variable, not in your code.
   export ANKINIZE_API_KEY="paste-your-key-here"
   
   curl https://ankinize.com/api/v1/decks \
     -H "Authorization: Bearer $ANKINIZE_API_KEY"
   ```
   
   You should get back the decks in your collection:
   
   Response · 200
   
   ```
   {
     "decks": [
       { "id": 1, "name": "Default" },
       { "id": 1736899200123, "name": "Languages::German" }
     ]
   }
   ```

> Good to know
> 
> Your storage counts the collection plus every media file, in full. You can see how much you use on the dashboard, and export a copy of everything at any time.

## For AI agents

Ankinize publishes what an agent needs to use it without a person explaining the API. There is one skill for the TypeScript SDK and one for the REST API, so an agent can pick the one that fits the code it is writing.

| Resource | What it is |
| --- | --- |
| [https://ankinize.com/.well-known/agent-skills/ankinize-sdk/SKILL.md](https://ankinize.com/.well-known/agent-skills/ankinize-sdk/SKILL.md) | The agent skill for the TypeScript SDK: set-up, every function, batches, errors, retries and type-safe names. Load this when the task is TypeScript or JavaScript. |
| [https://ankinize.com/.well-known/agent-skills/ankinize-api/SKILL.md](https://ankinize.com/.well-known/agent-skills/ankinize-api/SKILL.md) | The agent skill for the REST API: authentication, conventions and every endpoint. Use it from any other language or with plain HTTP. |
| [https://ankinize.com/.well-known/agent-skills/index.json](https://ankinize.com/.well-known/agent-skills/index.json) | The discovery index of both skills, with the SHA-256 of each file. |
| [https://ankinize.com/llms.txt](https://ankinize.com/llms.txt) | The llms.txt index: what Ankinize is, and a link to every page and skill. |
| [https://ankinize.com/llms-full.txt](https://ankinize.com/llms-full.txt) | Every documentation page in one Markdown file. |
| [https://ankinize.com/api/v1/openapi.json](https://ankinize.com/api/v1/openapi.json) | The OpenAPI document: exact parameters and responses. SDK functions are named after its operation ids. |

Any page of these docs is also available as Markdown: add `.md` to its address (`https://ankinize.com/docs/sdk.md`), or ask for it with `Accept: text/markdown`.

## Words used in these docs

| Term | Meaning |
| --- | --- |
| Collection | Everything in your Anki profile that is not a media file: decks, notes, cards, note types and their scheduling. |
| Media Files | Images, audio and video that your notes refer to. |
| Note | One piece of content with named fields. Anki turns it into one or more cards. |
| Note type | The template for notes: which fields they have and which cards they make. |
| Full sync | Anki downloads or uploads the whole collection instead of only the changes. Some changes, such as removing a field, force one on every device. |
| Scope | What an API key may do: sync, read or write. |
