Official API clients for ZeroGPU.
Typed helpers for responses, chat completions, moderations, embeddings, and audio — publishable packages on npm (zerogpu-api) and PyPI (pip install zerogpu-sdk → import zerogpu).
ZeroGPU API SDKs are the official API client libraries for ZeroGPU. Use them to call responses, chat completions, moderations, embeddings, and audio (transcriptions and speech) with your API key.
API reference and guides: docs.zerogpu.ai (authentication, models, error codes).
| Registry | Package | Source |
|---|---|---|
| npm | zerogpu-api |
npm/ (bundles sdks/typescript) |
| PyPI | zerogpu-sdk (import zerogpu) |
pypi/ (synced from sdks/python) |
Environment variables (same as the dashboard snippets):
ZEROGPU_API_KEY
Clients always use the production API base URL https://api.zerogpu.ai/v1. There is no environment variable to change it.
Smoke tests — one live POST /v1/responses per SDK (TypeScript and Python); see smoke/README.md. TypeScript example:
cd smoke/typescript
npm install
export ZEROGPU_API_KEY=…
export ZEROGPU_MODEL=… # from your dashboard
npm run smokeDo not commit secrets.
The OpenAPI spec models input as either a non-empty string or a non-empty array of role / content messages, matching what production accepts.
- Production base URL:
https://api.zerogpu.ai/v1 - Path:
/responses - Headers:
x-api-key,content-type: application/json
Full spec: Responses API.
Also supported: POST /v1/chat/completions (client.chat), POST /v1/moderations (client.moderations), POST /v1/embeddings (client.embeddings), and POST /v1/audio/transcriptions / POST /v1/audio/speech (client.audio). Optional metadata on POST /v1/responses carries model-specific options (e.g. PII).
The clients in sdks/typescript and sdks/python are maintained by hand. When the API changes, update specs/zerogpu.openapi.yaml and both clients together, then run ./scripts/sync-pypi-from-sdks.sh.
| Path | Registry | Package name (change if taken) |
|---|---|---|
npm/ |
npmjs.com | zerogpu-api (see npm/package.json) |
pypi/ |
PyPI | zerogpu-sdk — pip install zerogpu-sdk imports zerogpu |
npm
cd npm
npm install
npm run build
npm publish --access publicPyPI — use a venv and PyPI API token:
./scripts/sync-pypi-from-sdks.sh # copy sdks/python into pypi/src/zerogpu
cd pypi
python -m venv .venv && . .venv/bin/activate
pip install build twine
python -m build
twine upload dist/*| Path | Description |
|---|---|
specs/zerogpu.openapi.yaml |
OpenAPI reference for the API |
sdks/ |
TypeScript and Python client source |
npm/ |
npm package (tsup bundles sdks/typescript) |
pypi/ |
PyPI package (src/zerogpu synced from sdks/python) |
scripts/sync-pypi-from-sdks.sh |
Copy sdks/python into the PyPI package |
smoke/ |
Live-request smoke tests for TypeScript and Python (see smoke/README.md) |
Add a root LICENSE when you publish; align it with the npm and PyPI packages.
