import asyncio
import os
from kaizen_client import KaizenClient, KaizenClientConfig
async def main():
# Ensure environment variables are loaded properly
config = KaizenClientConfig(
api_key=os.getenv("KAIZEN_API_KEY"),
base_url=os.getenv("KAIZEN_BASE_URL", "https://api.getkaizen.io/"),
timeout=float(os.getenv("KAIZEN_TIMEOUT", "30"))
)
async with KaizenClient(config) as client:
response = await client.prompts_encode({
"prompt": {"messages": [{"role": "user", "content": "Test authentication"}]},
"token_models": ["gpt-4o-mini"]
})
print("Authentication successful! Reduction:", response["stats"]["reduction_ratio"])
asyncio.run(main())