Skip to main content

Official ZeroGPU Python SDK (Responses API and Chat Completions)

Project description

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/).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zerogpu_api-0.1.3.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zerogpu_api-0.1.3-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file zerogpu_api-0.1.3.tar.gz.

File metadata

  • Download URL: zerogpu_api-0.1.3.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for zerogpu_api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 25f19b051a0070a14c94d431338194ad70b9b28534a42045a3ee6d7302f4e6a7
MD5 000c68794225433086b34fea10cd7559
BLAKE2b-256 34a80207c33bb9a79a1ffb5670591c674b26c8c9c5063e6a49ae7856d88877b8

See more details on using hashes here.

File details

Details for the file zerogpu_api-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: zerogpu_api-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 51.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for zerogpu_api-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2b1ae51c7b6995dcf50b961f2ea119424bbcd7decd470d1e280b437529643670
MD5 42327e38ab58fe9f65a7dea07f39bd67
BLAKE2b-256 ecebd292c7f0a2e2acdee77db149967465a22f163c1b707e04792efed41401ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page