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

# Providers and models

> Pick a provider, sign in, and choose a model. Fleet Prime Agent ships with 19 providers and a registry that knows each model's cost, context, and thinking levels.

Fleet Prime Agent talks to every model through `packages/ai`. That layer wraps 19 providers behind one interface and generates a registry of every model with metadata attached.

## Supported providers

The 19 provider implementations live under `packages/ai/src/providers/`. They include OpenAI, Anthropic, Bedrock, Gemini, plus 15 more — see the source or run `prime-agent model list` for the current list.

## Sign in

Two paths:

**API key.** Run `/login` inside a session and paste a key. The runtime writes it to `~/.prime/agent/auth.json` (mode `0600`). You can also pass it inline for a single run:

```bash theme={null}
prime-agent --provider openai --model gpt-4o --api-key "$OPENAI_API_KEY"
```

**OAuth.** For providers that support OAuth (e.g. GitHub Copilot), `/login` walks the flow and returns `OAuthCredentials`. Credentials are refreshed dynamically via `getApiKey` so long-running sessions keep working even when tokens rotate mid-run. See [OAuth guide](/fleet-prime-agent/guides/oauth).

Environment variables also work — see `packages/ai/src/env-api-keys.ts` for the full list of recognized keys, and set `--no-env` to strip them if you want to isolate a run.

## Pick a model

Every model in the registry (`packages/ai/src/models.generated.ts`) is a `Model<TApi>` with:

* **Cost** — per-token pricing
* **Context window** — max tokens the model can hold
* **Reasoning** — whether the model streams thinking traces
* **Thinking levels** (`thinkingLevelMap`) — off / minimal / low / medium / high / xhigh / max

Pick one at launch:

```bash theme={null}
prime-agent --provider anthropic --model claude-sonnet-4 --thinking high
```

List models programmatically with `getProviders()` and `getModels()` (`packages/ai/src/models.ts`), or from the CLI:

```bash theme={null}
prime-agent model list
```

## Switching mid-session

Change model between turns with the CLI flags on `--resume`, or use the model picker in the web UI. The session records which model produced which turn so a mixed-model transcript stays coherent.

## Related

* [OAuth](/fleet-prime-agent/guides/oauth) — provider sign-in over OAuth.
* [Configuration](/fleet-prime-agent/reference/configuration) — where credentials live and how they're loaded.
* [Security](/fleet-prime-agent/reference/security) — trust model and credential storage.
