tokens.create(...), commit operations with author, and token lifetimes all keep working the way they do today.
What changes
Moving a client from an API key to a private key changes these behaviors:orgis no longer a client option. The key is bound to one organization.authorsbecomes required. Minting tokens, MesaFS mounts, and commit operations all take an orderedauthorslist.- Token lifetimes shrink. Private-key tokens default to 15 minutes and max out at 4 hours. API-key tokens default to 1 hour and max out at 24.
- Sandboxes read
MESA_ACCESS_TOKEN.MESA_API_KEYstays reserved for actual API keys and takes precedence if both are set. - The SDK
authoption only accepts private-key tokens. Tokens minted by an API-key client keep working in the CLI, REST, and MesaFS mounts, just not there.
1
Create a private key
In the dashboard, open your organization’s settings and create a key under Keys. The private key is shown once, so save it to your secrets manager as
MESA_PRIVATE_KEY before leaving the page. Mesa stores only the matching public key.2
Update trusted SDK clients
Replace the API key with the private key in backends and orchestrators you trust:The
org option goes away: a private key is bound to a single organization. Authors move to the individual operations.3
Mint tokens for sandboxes and jobs
Mint a short-lived token in the trusted process, then pass only that token to the less-trusted environment.Private-key tokens default to a 15 minute lifetime and cannot exceed 4 hours. Pick a value that covers the whole job or mount.
tokens.create(...) now takes authors. Every commit the token writes is attributed to that list, so it records who the sandbox’s work belongs to. See Authentication for more info.4
Use MESA_ACCESS_TOKEN in the receiving environment
Replace the sandbox’s The CLI picks up
MESA_API_KEY variable with MESA_ACCESS_TOKEN:MESA_ACCESS_TOKEN automatically. For SDK code running in the sandbox, pass the token through auth: { accessToken } in TypeScript or auth={"access_token": token} in Python.5
Update REST and MCP credentials
Use the access token anywhere you previously sent the raw API key as a bearer credential.Keep the minting step in trusted infrastructure, and never copy the private key into an MCP client, sandbox, or browser.
6
Revoke unused API keys
Once an API key is no longer used, revoke it in the dashboard. Revoking the key also invalidates any tokens minted from it.
What remains compatible
- SDK clients and the CLI still accept
apiKey,api_key, andMESA_API_KEY. - API-key clients can still call
tokens.create(...)withscopes,repos,repo_ids, and a lifetime of up to 24 hours. - Commit operations on API-key clients keep their singular
authorparameter. - Existing REST, MCP, and MesaFS API-key integrations keep their current behavior.

