> ## Documentation Index
> Fetch the complete documentation index at: https://developer.revise.io/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). Configure your account and balance in the [console](https://revise.io/console) before submitting paid work. Your API key is separate from an npm access token for Revise Editor SDK and from any provider key configured on your account.

## 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; do not put it in browser bundles, query strings, or public repositories. Do not forward it to a remote input document's URL.

## 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.

Creation endpoints require an `Idempotency-Key`. Give each logical operation a stable key and reuse it only with the same request. Uploading a file and creating a job are separate operations with separate keys. See [errors and retries](/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.
