zerogpu-api
v0.1.4
Published
Official ZeroGPU API client (Responses + Chat Completions)
Maintainers
Readme
zerogpu-api
Official ZeroGPU API client for Node.js and TypeScript. Covers POST /v1/responses and POST /v1/chat/completions with the same headers (x-api-key, x-project-id).
Install
npm install zerogpu-apiQuick start — Responses
input may be a plain string or an array of { role, content } messages, depending on the model.
import { ZerogpuApiClient } from "zerogpu-api";
const client = new ZerogpuApiClient({
apiKey: process.env.ZEROGPU_API_KEY!,
projectId: process.env.ZEROGPU_PROJECT_ID!,
});
const response = await client.responses.createResponse({
model: "zlm-v1-followup-questions-edge",
input: "In one short sentence, what is a habit tracker?",
text: { format: { type: "text" } },
});
console.log(response.output);Optional metadata (Responses)
Some models accept extra options on the responses route (e.g. PII mask / usecase):
await client.responses.createResponse({
model: "gliner-multi-pii-v1",
input: "Your text…",
metadata: { mask: "label", usecase: "redact" },
});Chat completions
For models that use the chat-completions shape:
const completion = await client.chat.createChatCompletion({
model: "gliner-multi-pii-v1",
messages: [{ role: "user", content: "Your text…" }],
metadata: { mask: "label", usecase: "redact" },
});
console.log(completion);Environment variables
ZEROGPU_API_KEYZEROGPU_PROJECT_IDZEROGPU_API_URL— optional override only; if unset, the client uses productionhttps://api.zerogpu.ai/v1
API reference
Maintainers
From this npm/ directory:
npm install
npm run build
npm publish --access publicThis package bundles the generated TypeScript SDK from ../sdks/typescript via tsup.
