The MindSim client requires a valid API Key to make requests. The SDK supports three authentication strategies designed for different environments.
Best for: Local prototyping, exploration, and individual development.
The SDK comes with a CLI tool that handles OAuth authentication via your browser.
~/.mindsim/config.Best for: CI/CD pipelines, Docker containers, and production deployments.
The SDK looks for the MINDSIM_API_KEY environment variable. This takes precedence over local configuration files.
Best for: Applications using secret managers (AWS Secrets Manager, Vault) where keys are retrieved at runtime.
You can pass the API key directly as the first argument to the constructor.
If the SDK cannot find an API key in the environment variables, the local config file, or the constructor arguments, it will throw an error:
Error: API Key not found. Please run mindsim auth or pass the key to the constructor.