Klavis-AI/python-sdk
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FKlavis-AI%2Fpython-sdk) [](https://pypi.python.org/pypi/klavis)
The Klavis Python library provides convenient access to the Klavis APIs from Python.
pip install klavisA full reference for this library is available here.
Instantiate and use the client with the following:
from klavis import Klavis
client = Klavis(
api_key="YOUR_API_KEY",
)
client.mcp_server.call_tools(
server_url="serverUrl",
tool_name="toolName",
)The SDK also exports an async client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use httpx.AsyncClient() instead of httpx.Client() (e.g. for the httpx_client parameter of this client).
import asyncio
from klavis import AsyncKlavis
client = AsyncKlavis(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.mcp_server.call_tools(
server_url="serverUrl",
tool_name="toolName",
)
asyncio.run(main())When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error will be thrown.
from klavis.core.api_error import ApiELoading reviews...