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

# Client Initialization

> This page explains how to initialize the Ekiden SDK in TypeScript and Rust. Initialization sets up your client to interact with Ekiden's REST and WebSocket APIs. You can operate in either public mode (read-only access) or authenticated mode (private endpoints and trading).

## Supported Environments

Ekiden supports the following environments:

| Environment  | Network Key | REST URL                                                                   | WebSocket URL                  |
| ------------ | ----------- | -------------------------------------------------------------------------- | ------------------------------ |
| Testnet Beta | testnet     | [https://api.cnt.ekiden.fi/api/v1](https://api.cnt.ekiden.fi/api/v1)       | wss\://api.cnt.ekiden.fi/ws    |
| Devnet       | testnet     | [https://api.canton.ekiden.fi/api/v1](https://api.canton.ekiden.fi/api/v1) | wss\://api.canton.ekiden.fi/ws |

Use the network parameter during client initialization to select your target environment.

## Initialization Parameters

| Parameter      | Description                          | Required              | Default |
| -------------- | ------------------------------------ | --------------------- | ------- |
| network        | mainnet or testnet                   | No                    | mainnet |
| api\_key       | For private endpoints                | Yes (if API key auth) | —       |
| private\_key   | Alternative for signature-based auth | Yes (if no API key)   | —       |
| subaccount\_id | Optional subaccount ID               | No                    | 0       |
| use\_websocket | Enable WS connections                | No                    | true    |

{/* TODO(SDK): Verify and update the client initialization parameters against the current TypeScript SDK. The documented parameters and defaults may not match the current EkidenClient configuration. */}
