Installation
Install the Obiguard SDK from PyPI:API Key Setup
- Create a Obiguard API key in your dashboard.
- Store your API key securely as an environment variable:
The SDK automatically detects your API key from the environment.
Quickstart
Here’s a minimal example to get you started: You can use either a Virtual Key or a Config object to select your AI provider.
Find more info on different authentication mechanisms
here.
Authentication & Configuration
The SDK requires:- Obiguard API Key: Your Obiguard API key (env var
OBIGUARD_API_KEY
recommended) - Provider Authentication:
- Virtual Key: The Virtual Key of your chosen AI provider
- Provider Slug + Auth Headers: Useful if you do not want to save your API keys to Obiguard and make direct requests.
Async Usage
Obiguard supports Async usage - just useAsyncObiguard
client instead of Obiguard
with await
:
Python
Using a Custom httpx Client
If you need to customize HTTP networking—for example, to disable SSL verification due to VPNs like Zscaler or to use custom proxies—you can pass your ownhttpx.Client
to the Obiguard SDK.
Disabling SSL certificate verification is insecure and should only be used for debugging or in trusted internal
environments. Never use this in production.
- You can use any
httpx.Client
options (e.g., for proxies, timeouts, custom headers). - For async usage, pass an
httpx.AsyncClient
toAsyncObiguard
. - See OpenAI Python SDK: Configuring the HTTP client for more examples and best practices.
Parameters
List of All Headers
View the complete list of headers that can be used with Obiguard API requests, including authentication,
configuration, and custom headers.
Troubleshooting & Support
- Having trouble? Email support.
FAQs
Can I use this SDK with OpenAI-compatible code?
Can I use this SDK with OpenAI-compatible code?
Yes! Obiguard’s Python SDK is OpenAI-compatible. You can also use any OpenAI-compatible library by pointing it to
the Obiguard API endpoint and using your Obiguard API key.
How do I fix CERTIFICATE_VERIFY_FAILED or SSL errors?
How do I fix CERTIFICATE_VERIFY_FAILED or SSL errors?
If you are behind a VPN (like Zscaler) or a corporate proxy and see SSL/certificate errors, you can pass a custom
httpx.Client
to the Obiguard SDK with SSL verification disabled. See the docs above for an example. Warning:
Disabling SSL verification is insecure—only use this as a last resort or for debugging.Where can I find more examples?
Where can I find more examples?
Check out our integration docs here.