> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ev-cloud.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ev-cloud.ai/_mcp/server.

# TypeScript SDK

## Install

```bash
npm i evcloud-sdk
```

## Create a client

Pass the production API, `https://api.ev-cloud.ai`, as `environment`.

```typescript
import { EvcloudSDK } from "evcloud-sdk";

const client = new EvcloudSDK({
    environment: "https://api.ev-cloud.ai",
    token: process.env.EVCLOUD_TOKEN!,
});
```

See [Authentication](/get-started/authentication) for the token.

## Make a call

Each domain is a namespace: `client.cpo`, `client.emsp`, `client.energy`, `client.webhooks` and `client.ocpi`. Request and response fields keep the API's snake_case names; methods are camelCase.

```typescript title={"quickstart.ts"}
import { EvcloudSDK } from "evcloud-sdk";

const client = new EvcloudSDK({
    environment: process.env.EVCLOUD_BASE_URL!, // e.g. https://api.ev-cloud.ai
    token: process.env.EVCLOUD_TOKEN!,
});

async function main(): Promise<void> {
    // List methods return a page you can iterate across every page.
    const locations = await client.cpo.locations.list({ limit: 50 });
    for await (const location of locations) {
        console.log(location.location_id, location.name);
    }

    // Cap a charger at 11 kW, then read the charger's answer.
    const request = await client.energy.controlRequests.create({
        charge_point_id: "CP-AMS-001",
        action: "SET_EVSE_INPUT_LIMIT",
        connector_id: 0,
        limit: 11000,
        unit: "W",
    });
    const outcome = await client.energy.controlRequests.get({ request_id: request.request_id });
    console.log(outcome.result);
}

main();

```

Errors, retries and which calls are never resent: [Errors and retries](/sdks/errors-and-retries).