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

Install

pip install cynsta-spendguard

or with uv:

uv tool install cynsta-spendguard

Usage

Create an agent:

spendguard agent create --name "agent-1"

List agents:

spendguard agent list

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)

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.1.0.tar.gz (7.3 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.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cynsta_spendguard-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 64ccb968d30124bc2e3c5570fefb1f4150d31ccd05c5c135a7671867accd687f
MD5 ba5bdcd3839d21849d912f8ec3754aa7
BLAKE2b-256 5729e99306160adcbfe5b70145c9b9aa02f02f851f0bdc977e7a8d10d3360184

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cynsta_spendguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a4fd57eceb74b93630d3eab17aafb2d580931b68f634075f8798cefb37c074
MD5 a10123383a8f93c5827471d9c8b96b48
BLAKE2b-256 32403cc6355eaa02aef0b617fbc93964ab1158985cdf9b61a1a9628c40b67195

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