Runnable examples showing common uses of the @javaabu/dhivehigpt-sdk SDK.
Set your API key first:
export DHIVEHIGPT_API_KEY=your-api-key-hereRun directly with Node.js's built-in TypeScript stripping (Node 22.6+), or with tsx/ts-node:
node examples/list-voices.ts
node examples/generate-tts.ts
node examples/get-balance.ts
node examples/calculate-task-cost.ts
node examples/error-handling.ts
# or, on older Node versions:
npx tsx examples/list-voices.tsnode examples/commonjs-usage.cjsEach example imports from @javaabu/dhivehigpt-sdk. When running the examples from within this repository
before the package is published, build the SDK first so node_modules/local resolution picks up the
compiled output:
npm run build