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

# Authentication

> Authenticate REST requests with a Revise API key.

Create a key in the [API console](https://revise.io/console/api-keys) and add credit in [billing](https://revise.io/console/billing). Copy the secret when it is created; it is not shown again. The public TypeScript package needs no npm access token.

## Bearer authentication

Send the key on every account request, including artifact downloads:

```bash theme={null}
export REVISE_API_KEY='your-api-key'

curl --fail-with-body 'https://revise.io/api/v1/account' \
  -H "Authorization: Bearer $REVISE_API_KEY"
```

Use HTTPS in production. Store the key in server-side configuration. Don't put it in browser bundles, query strings, or public repositories, and don't send it to a remote input document's URL.

Keys grant access to the API account's resources. Files and jobs are account-scoped, so another active key on the same account can retrieve them. Use separate keys per service or environment to identify submissions and revoke access independently. Separate keys share the same storage and balance.

To rotate a key, create a replacement, update your application, verify an account request, then revoke the old key in the console. Expired or revoked keys return `401`. Provider keys are configured separately; see [models and provider keys](/developer/docs/developer/docs/revise-api/models).

## Request bodies

JSON requests use `Content-Type: application/json`. File uploads use `multipart/form-data`; let your HTTP library generate the boundary. Actions with no request body, such as cancellation and deletion, send no JSON body. Successful `204` responses have no JSON to parse.

Uploads, job creation, webhook registration, and manual delivery retries require an `Idempotency-Key`. Give each logical operation a stable key and reuse it only with the same request. See [errors and retries](/developer/docs/developer/docs/revise-api/errors).

## TypeScript

```ts theme={null}
import { ReviseClient } from "@reviseio/api";

const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const account = await revise.account.get();
```

The default client base URL is `https://revise.io/api`. If you override it, omit the trailing `/v1`; the client adds endpoint paths itself. The client generates idempotency keys when omitted, but explicit keys let your application recover across process restarts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.