Skip to Content
SDKsPython

Python SDK

Use the Python SDK when your backend services or scripts are written in Python and you want governed AI calls with a one-line import change.

Install

pip install keel-sdk

Quick example

from keel_sdk.providers.openai import OpenAI client = OpenAI() response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}], max_tokens=128, ) print(response["choices"][0]["message"]["content"])

The SDK evaluates governance before the provider call. If the request is denied, a KeelError is raised before any provider call is made.

For provider wrappers, streaming, error handling, configuration, and the direct client reference, see SDKs.

Last updated on Edit this page on GitHub