Python SDK for Lamatic.
Requires Python 3.10+
pip install lamatic-pythongit clone https://github.com/your-org/lamatic-python.git
cd lamatic-python
pip install -e .pip install -e ".[dev]"from lamatic import Lamatic
lamatic = Lamatic(
endpoint="https://your-project.lamatic.ai/api/graphql",
project_id="your-project-id",
api_key="your-api-key",
)
# Execute a flow (sync)
response = lamatic.execute_flow("flow-id", {"prompt": "Hello!"})
print(response.status) # "success"
print(response.result)
# Poll status
response = lamatic.check_status("request-id", poll_interval=5, poll_timeout=120)import asyncio
from lamatic import Lamatic
lamatic = Lamatic(
endpoint="https://your-project.lamatic.ai/api/graphql",
project_id="your-project-id",
api_key="your-api-key",
)
async def main():
response = await lamatic.async_execute_flow("flow-id", {"prompt": "Hello!"})
print(response.status)
print(response.result)
asyncio.run(main())Either api_key or access_token is required:
# API key auth
lamatic = Lamatic(endpoint=..., project_id=..., api_key="your-api-key")
# Access token auth
lamatic = Lamatic(endpoint=..., project_id=..., access_token="your-token")
# Refresh token at runtime
lamatic.update_access_token("new-token")