Skip to main content

sardis-openai

OpenAI function calling tools for Sardis - Payment OS for AI Agents.

Installation

pip install sardis-openai

Quick Start

from openai import OpenAI
from sardis_openai import get_sardis_tools, SardisToolHandler

client = OpenAI()
handler = SardisToolHandler(api_key="sk_sardis_...")

# Get Sardis tool definitions
tools = get_sardis_tools()

# Use with Chat Completions
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Pay $25 to OpenAI for API credits"}],
    tools=tools,
)

# Handle tool calls
for tool_call in response.choices[0].message.tool_calls:
    result = await handler.handle(tool_call)
    print(result)

Available Tools

Tool Description
sardis_pay Execute payment with policy enforcement
sardis_check_balance Check wallet balance and limits
sardis_check_policy Dry-run policy validation
sardis_issue_card Issue virtual card for agent
sardis_get_spending_summary Get spending analytics

All tools use strict mode to prevent hallucination.

Links

Metadata

Release files for sardis-openai 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sardis-openai 1.0.0
File Size Uploaded
sardis_openai-1.0.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sardis-openai 1.0.0
File Interpreter ABI Platform
sardis_openai-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / sardis_openai-1.0.0.tar.gz

Download URL sardis_openai-1.0.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d702260c06cba50e24d87635a33c87e73b4557638fc0ff0f050b8e1ef240c02d
BLAKE2b-256 checksum
How to use checksums
0e4f9e3415f4640ed56c814af5dab94df30d2d1ea2cb523a6b21070efa1f4619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / sardis_openai-1.0.0-py3-none-any.whl

Download URL sardis_openai-1.0.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1fd8b57caaa732fd0e017be4c180c993fc4c37317a9aaa3fe21cc49ac020221
BLAKE2b-256 checksum
How to use checksums
92236070b747680976097448e1ffbde3aa324856ee3862d4fc32fc9740e3bcfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page