Skip to main content

Authentication

All Meshbrow API requests require authentication via an API key.

API Keys

API keys are prefixed with mb_live_ (production) or mb_test_ (sandbox). Pass your key in the Authorization header:

CLI Authentication

The fastest way to authenticate the CLI is the browser flow:
This opens your browser to meshbrow.dev/cli/authorize. Confirm the code shown in your terminal matches the one in the browser, click Authorize, and the CLI completes automatically — an API key is generated for your account and saved to ~/.meshbrow.yaml. To authenticate without a browser (CI, headless servers), pass a key directly:

SDK Authentication

Key Security

Never commit API keys to source control. Use environment variables or a secrets manager.
Best practices:
  • Store keys in environment variables (MESHBROW_API_KEY)
  • Use different keys for development and production
  • Rotate keys periodically via the dashboard
  • Restrict key permissions by scope (sessions, fleet, billing)

Rate Limits

Rate limit headers are included in every response:

Error Responses

Authentication errors return 401 Unauthorized: