> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Choose an API key or OAuth and understand credential permissions.

You can list tools and read their schemas without credentials. To run tools or read private task data, use a credential that has access to the operation.

## API keys

Create a restricted key in the [Mouter dashboard](https://mouter.ai/dashboard). In an API or MCP request, send it in the `Authorization: Bearer YOUR_API_KEY` header. For the CLI, supply `MOUTER_API_KEY` through your secret environment.

Store the key in a secret manager. Keep it out of URLs, source control, command arguments, and prompts.

For the CLI, choose a sign-in method by environment:

| Environment | Method |
| - | - |
| A machine with a browser | Browser OAuth: `mouter auth login` |
| SSH, containers, or remote agent sandboxes without a browser | Device code: `mouter auth login --device` |
| CI and batch jobs | An API key in `MOUTER_API_KEY` |

See [`mouter auth`](/docs/cli/authentication) for requirements, where the CLI stores credentials, token refresh, and sign-out.

## OAuth

Use browser sign-in for [the CLI](/docs/cli/authentication.md) and compatible [MCP clients](/docs/connect-via-mcp.md). Applications acting on behalf of users can [integrate with OAuth](/docs/integrations/oauth.md).

Request the permissions your client needs:

| OAuth scope | What it allows |
| - | - |
| `tools:execute` | Execute tools permitted by the grant. |
| `tasks:read` | Read tasks submitted under the same authorization. |
| `billing:read` | Read credit balance, usage, and task billing where supported. |

An active tool can still be restricted by the credential. To read a task later, retain access to the API key or OAuth authorization that submitted it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.