Python SDK Reference
Complete API reference for the RunLog AI Python SDK.
Installation
pip install runlog-ai
API Methods
RL()
Initialize a new RunLog client
Signature
RL(service: str, env: str, api_key: str = None)
Example
rl = RL( service="my-agent", env="production", api_key="rl_..." )
rl.run()
Create a new agent run context
Signature
run(task: str, metadata: dict = None)
Example
with rl.run(task="user-query", metadata={"user_id": "123"}): # Your agent logic here pass
rl.tool()
Track external tool or API calls
Signature
tool(name: str, **kwargs)
Example
results = rl.tool( "search_api", query="python tutorial", max_results=10 )
rl.enforce()
Apply runtime policy enforcement
Signature
enforce(policy: str, **kwargs)
Example
rl.enforce( "max_cost_per_run", limit=1.00, currency="USD" )
Configuration Options
Available configuration parameters
Environment Variables
RUNLOG_API_KEY
Your API keyRUNLOG_BASE_URL
API base URLClient Options
timeout
Request timeoutretry_count
Retry attempts