Python SDK
Use the Gateway from Python, with a sync or an async client.
The package is basement-gateway. The source is on GitHub.
Install
Create the client
When you do not give api_key, the client reads the BASEMENT_API_KEY environment variable.
Call the Gateway
Each tool is a method. Arguments are keyword arguments, and answers are typed objects.
Async
AsyncBasementGateway has the same methods, with await:
Handle errors
A call that the Gateway refuses raises an ApiError with the HTTP status and the error body.
See Errors and limits for each status.
Timeouts and retries
A call times out after 60 seconds. The client tries a call again, up to 2 more times, when it gets 408, 429 or a 5xx status. Change both for the client or for one call:
Another address
The client talks to https://mcp.basement.chat. To use another deployment, give base_url: