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

# How licensing works

Your copy of `@reductoai/docx` and `@reductoai/docx-editor` carries your organization's license. You get it when you install with an install token from Studio. You do not call any license code. The package does two things in the background:

1. **It checks your license.** The first document opens only after a good check. After that, the package checks about every hour in the background, and each good check keeps it working for the next 65 minutes.
2. **It reports Sessions.** A Session is one document in use for up to 60 minutes. Reducto bills you per Session.

## What you set up

| Where the package runs | What you add |
| - | - |
| All projects | An install token in `.npmrc` |
| A server (Node, a worker, a script) | `REDUCTO_API_KEY` in its environment |
| A browser editor | The license proxy on your backend, and `proxyUrl` when you mount the editor |

[Set up](https://docs.reducto.ai/office/licensing/setup.md) shows each step.

## Terms

| Term | Meaning |
| - | - |
| Install token | The `rnpm_…` token in your `.npmrc`. It lets `npm install` download the packages |
| Reducto API key | Your usual Reducto API key. Your server sends it with usage reports, so Reducto can bill them to your organization |
| License proxy | A small route on your backend. A browser editor sends its license traffic there, and the route adds your API key. Your API key never goes to the browser |
| Session | One document in use, for about 60 minutes from its first activity. This is what you pay for |

> [!NOTE]
>
> A Session here is a billing unit. It is not `DocxSession`, the editing type in the [API reference](https://docs.reducto.ai/office/docx/api/word-document.md).

## What you pay for

You pay once per Session. A Session starts when you open or create a document, in code or in an editor. Work on the same document in the next 60 minutes is part of that Session. If you save the file and open it again in those 60 minutes, on any machine, it stays in the same Session.

A compare or a combine of two documents counts as one Session.

[Sessions and billing](https://docs.reducto.ai/office/licensing/sessions.md) gives examples.

## When the package stops

The package stops only in these cases. Each call then throws a `ReductoLicenseError`.

| Situation | Error |
| - | - |
| Reducto revoked your license | `revoked` |
| Your organization is out of Reducto credits | `unpaid`. It starts to work again after the next check once credits are added |
| Reducto does not know the license in your installed copy | `unknown` |
| Payment is required | `unpaid`, at once, without the 65 minutes |
| No good check before the first document opens (no license, no API key, or no connection) | `unconfigured` |
| The package could not reach Reducto for more than 65 minutes after its last good check | `unverified`. It starts to work again after the next good check |
| Reducto answers checks, but a new Session's usage report did not reach it within 30 seconds | `undelivered`. It starts to work again when a check confirms the report |

Reducto does not cap the number of Sessions, and the package never slows down because of it. It stops only when usage reports cannot be delivered (`undelivered` above).

## Next steps

* [Set up](https://docs.reducto.ai/office/licensing/setup.md): install, API key and browser proxy
* [Sessions and billing](https://docs.reducto.ai/office/licensing/sessions.md): what counts as a Session
* [License checks](https://docs.reducto.ai/office/licensing/checks.md): when the package checks and what happens offline
* [Troubleshooting](https://docs.reducto.ai/office/licensing/troubleshooting.md): errors and warnings
* [What the package sends](https://docs.reducto.ai/office/licensing/data.md): data and encryption, for your security review
* [Check protocol](https://docs.reducto.ai/office/licensing/protocol.md): retry timing and request bodies
