TypeScript SDK
Use the Gateway from Node.js, Bun, Deno or the browser.
The package is @basementai/gateway. The source is on GitHub.
Install
Create the client
When you do not give apiKey, the client reads the BASEMENT_API_KEY environment variable.
Call the Gateway
Each tool is a method. Arguments and answers are typed.
Handle errors
A call that the Gateway refuses throws a BasementGatewayError 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 baseUrl: