Authenticate API requests with a Sim API key, or an OAuth access token when your deployment enables OAuth. The CLI and registered OAuth applications can act with the permissions you approve.
Choose a key
A personal key identifies the acting member; it does not choose who pays. Hosted workspace usage is billed to the workspace's organization or personal billing account. In an organization, usage attributed to a member counts toward that member's cap. See Credits, billing and limits.
Workspace Admins can turn off Allow personal API keys. The workspace policy also blocks delegated OAuth access to that workspace. Permission groups can restrict personal-key and OAuth access further. Workspace keys do not inherit their creator's role or permission group; each endpoint's workspace-key policy determines whether they can call it.
Create and store a key
- Open Account settings → Sim API keys to create a personal key, or Workspace settings → Sim API keys to create a workspace key.
- Select Create API key and enter a name. Choose its Access and when it Expires, then create it. Workspace-key creation requires workspace Admin access and the applicable key-management permission.
- Copy the key and store it in a server-side environment variable such as
SIM_API_KEY.
Delete a key from the same settings page to revoke it. Update applications that used it with a replacement key.
Access
A read-only key cannot change workspace resources or run, resume, or cancel workflows. Reads can still cost credits: searches use embedding credits, and search chat uses model credits and keeps a private conversation history. Selector lookups call third-party services with your connected accounts.
A refused request fails with 403 and the message This API key is read-only and cannot perform this operation. Use a full-access API key. Where the surface carries a code, it is READ_ONLY_API_KEY: in error.details.code on the v2 API and the Sim MCP server, in details.code on the v1 API and workflow execution, and in error.data.code on a workflow MCP server.
Access narrows a key; it never grants more than the key's identity already has. Access is fixed at creation, so create a new key to change it. Keys created before access levels existed have full access. Keys created from the deploy modal or for a workflow MCP server always have full access, because they exist to run workflows.
Expiration
A key expires 30 days, 90 days, or 1 year after creation, or never. The settings page defaults to never. After it expires, every request with the key fails with 401. The v1 and v2 APIs, both MCP servers, and workflow execution answer with the message API key has expired. Create a replacement before then. The key list shows each key's expiration date. GET /api/v2/meta reports the calling key's expiresAt and scopes.
Send an API key
Send the key in X-API-Key. The v2 API accepts Authorization: Bearer only for OAuth access tokens, not API keys. For example, with SIM_API_KEY and WORKFLOW_ID set:
This runs the active deployment. Use your deployment's origin for self-hosted requests. Getting started includes complete HTTP examples and response handling.
Keys authenticate workflow execution, logs, deployed MCP servers, and other API resources that accept their key type. See each endpoint for its required access.
OAuth access tokens
Run sim login to authorize the CLI in your browser, or sim login --read-only to request read access. The CLI stores the login locally and refreshes its access token. See CLI authentication for profiles, sign-in, and sign-out.
Registered applications obtain tokens through the authorization-code flow with PKCE (S256). Send the access token in Authorization: Bearer:
Use X-API-Key for API keys and the Bearer header for OAuth access tokens. Send one credential scheme per request.
Scopes limit the application's actions; your current workspace membership, role, credential access, and permission policies still apply. Each endpoint declares its required scope. Some GET endpoints that perform external discovery require api:write, so HTTP method alone does not determine access.
Manage grants in Settings → General → Authorized apps. Revoking an application revokes all its logins for your account. For an OAuth login, sim logout revokes the current login and removes it locally; the CLI reports if server revocation fails. Removing a locally stored API key does not revoke that key on the server.
Protect credentials
Keep API keys and OAuth tokens on your server. A browser application should call an authenticated backend that checks which resources the caller may use before sending a Sim request. Do not put keys in client-side code or source control.
Sim supports modern sk-sim- and legacy sim_ API keys. On self-hosted deployments, stored API keys are encrypted when API_ENCRYPTION_KEY is configured; deployments without it retain the legacy plaintext storage behavior. Configure it using the environment-variable reference.