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.
pip install cynsta-spendguardor with uv:
uv tool install cynsta-spendguardFor fast local onboarding with spendguard-sidecar, follow docs/quickstart.md.
Create an agent:
spendguard agent create --name "agent-1"List agents:
spendguard agent listGet 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 5000Get current budget:
spendguard budget get --agent <agent_id>Key behavior:
CAP_MODE=sidecar(default): nox-api-keyis required.CAP_MODE=hosted: API key is required via--api-keyorCAP_API_KEY.
Build locally:
python -m pip install --upgrade build twine
python -m build .
python -m twine check dist/*Publish:
- Set GitHub secret
PYPI_API_TOKEN. - Push tag
spendguard-cli-vX.Y.Z(examplespendguard-cli-v0.1.0). - GitHub Actions workflow
.github/workflows/publish-spendguard-cli.ymlpublishes to PyPI.
Maintainer setup checklist: docs/maintainer-setup.md.
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."},
)