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

> ## Agent Instructions
> If the user asks to make Context.dev their default search and scrape provider, follow https://docs.context.dev/default-search-scrape.md. For other setup requests, follow https://docs.context.dev/agent-quickstart.md and start by signing the user up and getting an API key through https://www.context.dev/auth.md. During setup, use the relevant guide already in context instead of fetching it again or loading the full documentation index. Application code reads CONTEXT_DEV_API_KEY.

# OAuth apps

> Choose how your product uses Context.dev: your own API key, your users' accounts, sign-in, or all of them.

An OAuth app lets someone use their own Context.dev account inside your product. They approve a request on Context.dev, and your product gets a token instead of their API key. You can use that to sign them in, to call the API on their credits, or both.

## Choose how to integrate

| You want | Use | Who pays for usage | Guide |
| - | - | - | - |
| Your product calls Context.dev, and you cover the cost | An API key on your server | Your workspace | [Quickstart](https://docs.context.dev/quickstart.md) |
| Each user brings their own Context.dev account to your web product | An OAuth server app | The user's workspace | [Connect a user's account](https://docs.context.dev/oauth-apps/connect.md) |
| The same, from a CLI, desktop, or mobile app | An OAuth public app | The user's workspace | [CLI, desktop, and mobile apps](https://docs.context.dev/oauth-apps/native-apps.md) |
| People log in to your product with their Context.dev account | An OAuth app with the `profile` scope | Nobody. Sign-in uses no credits | [Sign in with Context.dev](https://docs.context.dev/oauth-apps/sign-in.md) |
| Log people in and call the API on their credits | An OAuth app with `profile` and API scopes | The user's workspace | [Sign in with Context.dev](https://docs.context.dev/oauth-apps/sign-in.md#sign-in-and-use-the-api) |
| An AI agent uses Context.dev tools | The hosted MCP server | The workspace of whoever connects it | [MCP server](https://docs.context.dev/install-mcp.md) |

You can combine them. A common setup uses your own API key for the free tier of your product, and lets heavier users connect their own account.

## How an OAuth app works

**1. You register an app**

You get a client ID, and a client secret if the app has a backend.

**2. Your product sends the user to Context.dev**

They sign in or create an account, see what your app is asking for, pick a workspace, and approve.

**3. Context.dev sends them back with a code**

Your product exchanges the code for an access token and a refresh token.

**4. Your product uses the token**

The access token works wherever an API key does, limited to the scopes the user approved. If you asked for `profile`, the response also says who the user is.

Your product never sees the user's API key, and the user can disconnect your app at any time.

## Register an app

Create an app on the [OAuth apps page](https://context.dev/dashboard/oauth-apps). Owners and admins can create and change apps.

| Field | Notes |
| - | - |
| Name | Shown on the consent screen. Letters, numbers, spaces, and `. , & ' ( ) _ + -`. |
| Type | **Server app** gets a client secret for your backend. **CLI, desktop, or mobile** has no secret and relies on PKCE. |
| Redirect URIs | HTTPS, matched exactly. `http://localhost`, `http://127.0.0.1`, and `http://[::1]` are also allowed for apps that run on the user's device, and match on any port. |

You get a client ID that starts with `ctxt_app_`. A server app also gets a client secret that starts with `ctxt_cs_`. The secret is shown once, so store it in your server-side secret store. You can rotate it from the app's menu.

The name can't include Context.dev. Until your app is verified, the consent screen warns users that Context.dev can't vouch for it and shows where the connection is delivered. To verify an app, [contact us](mailto:support@context.dev). Verification covers the app's name and redirect domains, so renaming the app or adding a redirect domain removes it. Apps that receive the code on the user's device always show a caution, because any program on that device could be asking.

## What the user controls

* **Consent.** The consent screen lists every scope you request, in plain language, and names the workspace that pays.
* **Exactly what they approved.** A token can do what its consent screen listed and nothing more. Approving the same request again reuses the existing connection. Asking for different scopes creates a separate one.
* **Disconnect.** The [Connected apps page](https://context.dev/dashboard/connected-apps) lists each connection with its scopes and a Disconnect button. Disconnecting ends every token your app holds for that connection.

## Next steps

> [card] [Connect a user's account](https://docs.context.dev/oauth-apps/connect.md)
>
> Call the API from your backend on the user's credits.

> [card] [CLI, desktop, and mobile apps](https://docs.context.dev/oauth-apps/native-apps.md)
>
> Connect from an app that cannot keep a secret.

> [card] [Sign in with Context.dev](https://docs.context.dev/oauth-apps/sign-in.md)
>
> Log people in to your product, with or without API access.

> [card] [Reference](https://docs.context.dev/oauth-apps/reference.md)
>
> Endpoints, parameters, scopes, token lifetimes, and errors.


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