Skip to main content

zerogpu-api (Python SDK)

Official Python SDK for the ZeroGPU API: POST /v1/responses and POST /v1/chat/completions, with x-api-key and x-project-id on every request.

Install

pip install zerogpu-api

Quick start — Responses

input may be a string or a list of message dicts / InputMessage, depending on the model.

import os
from zerogpu import ZerogpuApi

client = ZerogpuApi(
    api_key=os.environ["ZEROGPU_API_KEY"],
    project_id=os.environ["ZEROGPU_PROJECT_ID"],
)

response = client.responses.create_response(
    model="zlm-v1-followup-questions-edge",
    input="In one short sentence, what is a habit tracker?",
    text={"format": {"type": "text"}},
)
print(response)

Optional metadata (Responses)

client.responses.create_response(
    model="gliner-multi-pii-v1",
    input="Your text…",
    metadata={"mask": "label", "usecase": "redact"},
)

Chat completions

from zerogpu import ChatMessage

client.chat.create_chat_completion(
    model="gliner-multi-pii-v1",
    messages=[ChatMessage(role="user", content="Your text…")],
    metadata={"mask": "label", "usecase": "redact"},
)

API reference

Repository

Source and release workflow: github.com/zerogpu/SDK (Python package lives under pypi/).

Metadata

Release files for zerogpu-api 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zerogpu-api 0.1.3
File Size Uploaded
zerogpu_api-0.1.3.tar.gz 29.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zerogpu-api 0.1.3
File Interpreter ABI Platform
zerogpu_api-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 81.4 kB

Release files / zerogpu_api-0.1.3.tar.gz

Download URL zerogpu_api-0.1.3.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
25f19b051a0070a14c94d431338194ad70b9b28534a42045a3ee6d7302f4e6a7
BLAKE2b-256 checksum
How to use checksums
34a80207c33bb9a79a1ffb5670591c674b26c8c9c5063e6a49ae7856d88877b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Release files / zerogpu_api-0.1.3-py3-none-any.whl

Download URL zerogpu_api-0.1.3-py3-none-any.whl
Size 51.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b1ae51c7b6995dcf50b961f2ea119424bbcd7decd470d1e280b437529643670
BLAKE2b-256 checksum
How to use checksums
ecebd292c7f0a2e2acdee77db149967465a22f163c1b707e04792efed41401ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page