Skip to main content

SpendGuard SDK and CLI

Project description

SpendGuard SDK

Public SpendGuard repository for:

  • Python CLI package (cynsta-spendguard)
  • Python client library (spendguard_sdk)
  • API contracts (contracts/)
  • Public examples and docs

Supported provider endpoint families: openai, grok (xAI), gemini, anthropic.

Install

pip install cynsta-spendguard

or with uv:

uv tool install cynsta-spendguard

Quickstart

For fast local onboarding with spendguard-sidecar, follow docs/quickstart.md.

Usage

Create an agent:

spendguard agent create --name "agent-1"

List agents:

spendguard agent list

Get an agent:

spendguard agent get --agent <agent_id>

Rename an agent:

spendguard agent rename --agent <agent_id> --name "agent-1-renamed"

Delete an agent:

spendguard agent delete --agent <agent_id>

Set a budget for an existing agent:

spendguard budget set --agent <agent_id> --limit 5000 --topup 5000

Get current budget:

spendguard budget get --agent <agent_id>

Key behavior:

  • CAP_MODE=sidecar (default): no x-api-key is required.
  • CAP_MODE=hosted: API key is required via --api-key or CAP_API_KEY.

Release

Build locally:

python -m pip install --upgrade build twine
python -m build .
python -m twine check dist/*

Publish:

  1. Set GitHub secret PYPI_API_TOKEN.
  2. Push tag spendguard-cli-vX.Y.Z (example spendguard-cli-v0.1.0).
  3. GitHub Actions workflow .github/workflows/publish-spendguard-cli.yml publishes to PyPI.

Maintainer setup checklist: docs/maintainer-setup.md.

Python Client

from spendguard_sdk import SpendGuardClient

client = SpendGuardClient("https://spendguard.example.com", api_key="sk_cynsta_live_...")
agent = client.create_agent("agent-1")
client.set_budget(agent["agent_id"], hard_limit_cents=5000, topup_cents=5000)
run = client.create_run(agent["agent_id"])
resp = client.grok_responses(
    agent["agent_id"],
    run["run_id"],
    {"model": "grok-3", "input": "Give me a one-line summary of finite-state machines."},
)

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

cynsta_spendguard-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

cynsta_spendguard-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file cynsta_spendguard-0.2.0.tar.gz.

File metadata

  • Download URL: cynsta_spendguard-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cynsta_spendguard-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3cd3f5ad7d7e4c1d4f40a75f02c9a5530412cc26564e2ea36b02f5d3054e3323
MD5 49e5226448b16afb3e15c55d327beb9e
BLAKE2b-256 7f0aefb6e7d6f4daba9bbd5701e26841e836fa10eec6f896a6659b980dc19022

See more details on using hashes here.

File details

Details for the file cynsta_spendguard-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cynsta_spendguard-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98aa0fd5b4eb1cc245222841fa20b2bbf7c2eb844b6c53bf92133bbea8fcbb98
MD5 ff76cbe8d9c80f5f803cee3edc672f3f
BLAKE2b-256 09238ea0875c8e45d83034273255b42f522181ad205a8cfaa037dc93a21930a8

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