Skip to main content

semanticguard

Drop-in Python wrapper for the OpenAI Python SDK that routes requests through the SemanticGuard gateway for intelligent caching, cost tracking, and analytics.

Installation

pip install semanticguard

Quick start

from openai import OpenAI
from semanticguard import SemanticGuard

sg = SemanticGuard(api_key="sg-...", gateway_url="https://semanticguard.dev")
client = sg.wrap_openai(OpenAI(api_key="sk-..."))

# Use the client exactly as you normally would
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

Azure OpenAI

from openai import AzureOpenAI
from semanticguard import SemanticGuard

sg = SemanticGuard(api_key="sg-...", gateway_url="https://semanticguard.dev")
azure = AzureOpenAI(api_key="...", api_version="2024-02-01",
                     azure_endpoint="https://my-resource.openai.azure.com")
client = sg.wrap_azure(azure, resource="my-resource", deployment="gpt-4o")

AWS Bedrock

from openai import OpenAI
from semanticguard import SemanticGuard

sg = SemanticGuard(api_key="sg-...", gateway_url="https://semanticguard.dev")
client = sg.wrap_bedrock(
    OpenAI(api_key="not-used"),
    aws_access_key="AKIA...",
    aws_secret_key="...",
    region="us-east-1",
)

Project tagging

Pass a project argument to any wrapper to tag requests:

client = sg.wrap_openai(OpenAI(api_key="sk-..."), project="my-project")

License

MIT

Metadata

Release files for semanticguard 0.3.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 semanticguard 0.3.0
File Size Uploaded Provenance Actions
semanticguard-0.3.0.tar.gz 5.5 kB With provenance Details for semanticguard-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for semanticguard 0.3.0
File Interpreter ABI Platform Actions
semanticguard-0.3.0-py3-none-any.whl Python 3 none any Details for semanticguard-0.3.0-py3-none-any.whl

Total release size: 10.6 kB

Release files / semanticguard-0.3.0.tar.gz

Download URL semanticguard-0.3.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8f5d320a8cc2509f1958ee3ffb02369a58541df3a002cd4296f3093316b56394
BLAKE2b-256 checksum
How to use checksums
4df67f702fd56d854255ec1ee4a9b2141f2664a9e095f4f505eec63973bf4d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release files / semanticguard-0.3.0-py3-none-any.whl

Download URL semanticguard-0.3.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8334bac77cb6ee80568457a4fceaf05188a98c3d939dcdea4b018bc6bc80c8ea
BLAKE2b-256 checksum
How to use checksums
cde89a3d33b6042b11714b69c5ea3bb74c3bd8842196f245e9772fb47eddc37b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Security for semanticguard 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for semanticguard-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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