# SDKs

Source: https://tenergy.me/docs/sdk
Last updated: 2026-09-28

Two SDKs sign every request the way the API verifies it and verify webhook signatures. Neither is published yet: npm and PyPI packages arrive with the release. Other languages: generate a client from [`openapi.yaml`](https://tenergy.me/openapi.yaml).

| | TypeScript | Python |
|---|---|---|
| Package | `@tenergy/sdk` (npm, on release) | `tenergy` (PyPI, on release) |
| Install | `npm install @tenergy/sdk` | `pip install tenergy` |
| Webhook check | `verifyWebhookSignature(secret, timestamp, rawBody, signature)` | `verify_signature(secret, headers, body, tolerance_seconds=300)` |
| Example project | [tenergy-examples-ts](https://github.com/<org>/tenergy-examples-ts) | [tenergy-examples-py](https://github.com/<org>/tenergy-examples-py) |
| Full reference | [TypeScript SDK](https://tenergy.me/docs/sdk/typescript) | this page |

<!-- TODO(owner): replace <org> with the GitHub organisation of the public example repos. -->

## TypeScript

```ts title="TypeScript"
import { TenergyClient } from "@tenergy/sdk";
const client = new TenergyClient({ baseUrl: "https://api-nile.tenergy.me/v1", apiKey: process.env.TENERGY_KEY!, apiSecret: process.env.TENERGY_SECRET! });
const quote = await client.createQuote({ resource: "energy", amount: 65_000, tier: "1h", receiver });
const order = await client.createOrder({ quote_id: quote.id, client_order_id: `qs-${crypto.randomUUID()}` });
const settled = await client.waitForOrder(order.id, { timeoutMs: 120_000 });
```

## Python

```python title="Python"
import os, uuid
from tenergy import Client
client = Client(api_key=os.environ["TENERGY_KEY"], api_secret=os.environ["TENERGY_SECRET"], base_url="https://api-nile.tenergy.me/v1")
quote = client.create_quote({"resource": "energy", "amount": 65000, "tier": "1h", "receiver": receiver})
order = client.create_order({"quote_id": quote["id"], "client_order_id": f"qs-{uuid.uuid4()}"})
```

Poll `client.get_order(order["id"])` until the status is `active`, or wait for the `order.confirmed` [webhook](https://tenergy.me/docs/webhooks).

## Runnable quickstarts

Both projects walk prices → estimate → key → deposit → order → settled and print each step; any API error prints its slug and request id.

| Project | Run | Needs |
|---|---|---|
| `examples/ts-quickstart` | `npm install && npx tsx quickstart.ts` | Node.js 18+; `RECEIVER_ADDRESS`; `TENERGY_KEY`/`TENERGY_SECRET`, or it signs up with a generated wallet on Nile |
| `examples/py-quickstart` | `pip install -e . && python quickstart.py` | Python 3.9+; `TENERGY_KEY`/`TENERGY_SECRET` from [/app](https://tenergy.me/app) |

Keys are available right after signup; only the order needs a balance. Create the key before the deposit: the signup token lives 15 minutes, a deposit takes about a minute of confirmations. The five-step Nile run is in [Environments](https://tenergy.me/docs/environments#try-it-on-nile).
