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

# Installation

> Install the SDK, add your API key, and make a first call.

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @flamai/finesse ws
  ```

  ```bash pnpm theme={null}
  pnpm add @flamai/finesse ws
  ```

  ```bash yarn theme={null}
  yarn add @flamai/finesse ws
  ```

  ```bash bun theme={null}
  bun add @flamai/finesse
  ```
</CodeGroup>

`ws` is only needed for realtime in Node. Bun, Deno and browsers have a built-in `WebSocket`.

## Get an API key

1. Sign in to the [Finesse dashboard](https://finesse.flamapp.ai/dashboard).
2. Open **Settings → API keys** and create a key. Copy it right away: it is shown only once, and it
   starts with `flv_`.
3. Put it in your environment, where the SDK finds it:

```bash theme={null}
export FINESSE_API_KEY="flv_..."
```

<Frame>
  <img src="https://mintcdn.com/finesse-docs/aZKZ2HfBkeK2yXjC/images/api-keys.svg?fit=max&auto=format&n=aZKZ2HfBkeK2yXjC&q=85&s=067bc410835de81c333407f12ed5f5aa" alt="The API Keys page in the Finesse dashboard: name a key, press Create key, and copy it once" width="1200" height="560" data-path="images/api-keys.svg" />
</Frame>

<Warning>
  Keep the key on your server. Anyone who has it can spend your workspace's credits. For browsers and
  devices, use a [short-lived token](/sdks/tokens) instead.
</Warning>

## Make a first call

<CodeGroup>
  ```ts TypeScript theme={null}
  import { writeFile } from "node:fs/promises";
  import { Finesse, isReady } from "@flamai/finesse";

  const client = new Finesse(); // reads FINESSE_API_KEY

  // Pick any voice you can use: your own, or one from the public catalog.
  let voiceId = "";
  for await (const voice of client.voices.list()) {
    if (isReady(voice)) {
      voiceId = voice.id;
      break;
    }
  }

  const audio = await client.speech.create({ voice_id: voiceId, text: "Hello from Finesse!" });
  await writeFile("hello.wav", audio.data);
  ```
</CodeGroup>

`hello.wav` is a 24 kHz WAV file.

## Requirements

* Node 18 or later, Bun, Deno, or a modern browser (with a token).
* TypeScript 4.7 or later, if you use TypeScript. Types are included.
* No runtime dependencies; `ws` for realtime in Node.

### Runtimes

| Runtime | HTTP | Realtime |
| - | - | - |
| Node 18+ | built-in `fetch` | needs `ws`; the API key goes in a header |
| Bun | built-in | built-in `WebSocket`; the API key goes in a header |
| Deno | built-in | built-in `WebSocket`; from 2.5 the key goes in a header |
| Browsers | with `accessToken` | built-in `WebSocket`; the token is a subprotocol |

Browsers can't keep an API key secret, so a client holding a key refuses to run in one. Use a
[short-lived token](/sdks/tokens) instead.

## Versioning

The SDK follows [semantic versioning](https://semver.org). Before 1.0, minor versions may include
breaking changes; they are listed in the [SDK changelog](/sdks/changelog).

<CodeGroup>
  ```ts TypeScript theme={null}
  import { VERSION } from "@flamai/finesse";
  ```
</CodeGroup>


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