Python SDK for the dmstfy-gateway data plane (chat, embeddings, STT, TTS via one OpenAI-compatible endpoint)
Project description
demystify-gateway-sdk
Python client for the dmstfy-gateway data plane — a multi-tenant, OpenAI-compatible AI gateway with virtual keys, per-tenant rate limits, micro-USD budget ledgers, and usage metering.
Part of the Demystify Core Services suite. Sync and async clients are provided; both speak the same wire contract the gateway's mock and live backends share, so code written against the offline mock runs unchanged against a real deployment.
Install
pip install demystify-gateway-sdk
# or
uv add demystify-gateway-sdk
Quickstart
from demystify_gateway_sdk import create_gateway_client
client = create_gateway_client(
base_url="http://localhost:8080",
key="dmk_your_virtual_key",
product="my-app",
)
res = client.chat(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(res["choices"][0]["message"]["content"])
print("cost µUSD:", res["usage"]["cost_micro_usd"])
Async is symmetric:
from demystify_gateway_sdk import create_async_gateway_client
client = create_async_gateway_client(base_url="http://localhost:8080", key="dmk_...")
res = await client.chat(model="gpt-4o-mini", messages=[...])
Public API
| Symbol | Purpose |
|---|---|
create_gateway_client / GatewayClient |
Synchronous client |
create_async_gateway_client / AsyncGatewayClient |
Asyncio client |
SpeechResult |
Typed result for audio transcription/speech endpoints |
GatewayError |
Raised on non-2xx responses (carries status + error taxonomy code) |
See the module README for the full endpoint reference, the admin/control-plane API, and how to run the gateway offline with zero API keys.
License
MIT © Demystify Systems
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file demystify_gateway_sdk-0.2.0.tar.gz.
File metadata
- Download URL: demystify_gateway_sdk-0.2.0.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
292fecee338ade23b20088b63057afeed7f1c2ed1d186a9ae48c63d654541abc
|
|
| MD5 |
769e0283b4860db0b9c755b1b474a0cd
|
|
| BLAKE2b-256 |
8289560b7828ceb697ae86850d8529227f195acb61123d7d4723e2f28047d556
|
Provenance
The following attestation bundles were made for demystify_gateway_sdk-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on demystify-systems/ai-services-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
demystify_gateway_sdk-0.2.0.tar.gz -
Subject digest:
292fecee338ade23b20088b63057afeed7f1c2ed1d186a9ae48c63d654541abc - Sigstore transparency entry: 2171521295
- Sigstore integration time:
-
Permalink:
demystify-systems/ai-services-tools@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Branch / Tag:
refs/heads/claude/six-services-modular-build-h0faac - Owner: https://github.com/demystify-systems
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file demystify_gateway_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: demystify_gateway_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91ba3c065fc48c7f2fc7ece46db5985109641f3f66eba30958661d86dc02eb14
|
|
| MD5 |
d234ca24cba02de740f1c4d188712887
|
|
| BLAKE2b-256 |
d4fb153720e224096ca82c150faed5d61077bf3fdccb3fc114274e32a1877f13
|
Provenance
The following attestation bundles were made for demystify_gateway_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on demystify-systems/ai-services-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
demystify_gateway_sdk-0.2.0-py3-none-any.whl -
Subject digest:
91ba3c065fc48c7f2fc7ece46db5985109641f3f66eba30958661d86dc02eb14 - Sigstore transparency entry: 2171521300
- Sigstore integration time:
-
Permalink:
demystify-systems/ai-services-tools@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Branch / Tag:
refs/heads/claude/six-services-modular-build-h0faac - Owner: https://github.com/demystify-systems
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4dc06acee6676d683f961e82b0fd16cd7d433d27 -
Trigger Event:
workflow_dispatch
-
Statement type: