SDKs

Client Libraries

Official Python and TypeScript clients for the ClauseHub Energy API. Auto-generated from the OpenAPI spec, always up to date.

Python Client

Python
energy-api-client

Installation

$ pip install energy-api-client

Quick Start

Python
from energy_api_client import Client

client = Client(
    base_url="https://api.clausehub.net/energy",
    token="your-jwt",
)

# List all suppliers
suppliers = client.list_suppliers()

TypeScript Client

TypeScript
@clausehub/energy-api-client

Installation

$ npm install @clausehub/energy-api-client

Quick Start

TypeScript
import { Client } from '@clausehub/energy-api-client';

const client = new Client({
  baseUrl: 'https://api.clausehub.net/energy',
  token: 'your-jwt',
});

// List all suppliers
const suppliers = await client.listSuppliers();

Auto-generation

Both client libraries are automatically generated from the Energy API's OpenAPI specification on every merge to main. This ensures they are always in sync with the live API.

Do not manually edit

The client libraries are generated code. Any manual changes will be overwritten on the next build. If you need a change, update the OpenAPI spec or the generator templates and merge to main. The CI pipeline will regenerate and publish both packages automatically.

  • The OpenAPI spec is the single source of truth, served at GET /schema.
  • Each merge to main triggers the generation pipeline.
  • Both packages are versioned and published automatically.
  • Type safety and endpoint coverage are guaranteed by the spec.