Official API clients for ZeroGPU.
Call POST /v1/responses and POST /v1/chat/completions with typed helpers — publishable packages on npm (zerogpu-api) and PyPI (pip install zerogpu-api → import zerogpu).
ZeroGPU API SDKs are the official API client libraries for ZeroGPU. Use them to call POST /v1/responses with your API key and project id.
API reference and guides: docs.zerogpu.ai (authentication, models, error codes).
Clients live under sdks/:
| Directory | Language |
|---|---|
sdks/typescript |
TypeScript / JavaScript |
sdks/python |
Python |
sdks/go |
Go |
sdks/ruby |
Ruby |
sdks/java |
Java |
sdks/rust |
Rust |
sdks/csharp |
C# / .NET |
sdks/php/sdk |
PHP |
sdks/swift/sdk |
Swift |
When you publish packages to npm, PyPI, crates.io, etc., point users at those registries and docs.zerogpu.ai; most developers do not need the internals of the ZeroGPU API SDKs repository.
Environment variables (same as the dashboard snippets):
ZEROGPU_API_KEYZEROGPU_PROJECT_ID
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 generated SDK; see smoke/README.md. TypeScript example:
cd smoke/typescript
npm install
export ZEROGPU_API_KEY=…
export ZEROGPU_PROJECT_ID=…
export ZEROGPU_MODEL=… # from your dashboard
npm run smokeGo uses the repo go.work so builds resolve the sdk module; from the Fern SDK directory run go run -C smoke/go . (after exporting the same variables).
Do 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. Regenerate clients with Fern after changing specs/zerogpu.openapi.yaml.
- Production base URL:
https://api.zerogpu.ai/v1 - Path:
/responses - Headers:
x-api-key,x-project-id,content-type: application/json
Full spec: Responses API.
Also supported in the generated clients: POST /v1/chat/completions via client.chat (Python: client.chat) for models that use the chat-completions route. Optional metadata on POST /v1/responses is included in CreateResponseRequest for model-specific options (e.g. PII).
SDKs are generated from specs/zerogpu.openapi.yaml using Fern. To update or rebuild:
- Edit the OpenAPI file if the API changed.
- Run
npx fern-api checkfrom thefern/directory (or repo root with paths adjusted). - Run
npx fern-api generate(afterfern loginor withFERN_TOKEN). Generator groups and output paths are infern/generators.yml.
See Fern’s SDK quickstart for CLI install details.
ZeroGPU API SDKs ship standalone packages that do not rely on Fern’s paid registry flow:
| Path | Registry | Package name (change if taken) |
|---|---|---|
npm/ |
npmjs.com | zerogpu-api (see npm/package.json) |
pypi/ |
PyPI | zerogpu-api — pip install zerogpu-api 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 # after `fern generate` updates sdks/python
cd pypi
python -m venv .venv && . .venv/bin/activate
pip install build twine
python -m build
twine upload dist/*After regenerating Python with Fern, run sync-pypi-from-sdks.sh so pypi/src/zerogpu stays in sync with sdks/python.
Optional: Fern can also publish directly from generators.yml (npm, PyPI); you don’t need that if you use npm/ and pypi/ above.
| Path | Description |
|---|---|
specs/zerogpu.openapi.yaml |
API definition used for generation |
fern/ |
Fern configuration |
sdks/ |
Generated output (do not hand-edit; regenerate) |
npm/ |
npm package (tsup bundles sdks/typescript) |
pypi/ |
PyPI package (src/zerogpu synced from sdks/python) |
scripts/sync-pypi-from-sdks.sh |
Refresh Python package after Fern regen |
go.work |
Go workspace linking sdks/go and smoke/go for smoke runs |
smoke/ |
Live-request smoke tests per SDK (see smoke/README.md) |
Add a root LICENSE when you publish; align it with packages you ship to npm, PyPI, etc.
