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

# Providers

> Set up any of six model providers, or pass a one-off credential for a single scan.

The CLI calls a model provider that you own. `agentgg init` saves the credential to `~/.agentgg/config.json`. Pass flags on `agentgg scan` to use a different provider for one run instead. See [One-off credentials](/cli/providers#one-off-credentials) for the full flag list.

<Tip>
  Run `agentgg init` again to add a second provider. It keeps the credentials you
  already saved, and it makes the provider you just added the new default.
</Tip>

## Anthropic

Credential: an API key, or an OAuth token from a Claude Pro or Max plan.

```bash theme={null}
agentgg init --provider anthropic --api-key $ANTHROPIC_API_KEY
```

```bash theme={null}
agentgg scan ./src --provider anthropic -o ./out
```

## OpenAI

Credential: an API key.

```bash theme={null}
agentgg init --provider openai --api-key $OPENAI_API_KEY
```

```bash theme={null}
agentgg scan ./src --provider openai -o ./out
```

## Ollama

Credential: the local server URL. The default is `http://localhost:11434`.

```bash theme={null}
agentgg init --provider ollama --base-url http://localhost:11434
```

```bash theme={null}
agentgg scan ./src --provider ollama -o ./out
```

## AWS Bedrock

Credential: AWS credentials from the standard chain (environment variables, a profile, SSO, or an IAM role), plus a region.

```bash theme={null}
agentgg init --provider bedrock --region us-east-1
```

```bash theme={null}
agentgg scan ./src --provider bedrock -o ./out
```

## Google Vertex AI

Credential: Google Application Default Credentials (ADC), plus a GCP project ID.

```bash theme={null}
agentgg init --provider vertex --project my-gcp-project
```

```bash theme={null}
agentgg scan ./src --provider vertex -o ./out
```

## OpenRouter

Credential: an API key.

```bash theme={null}
agentgg init --provider openrouter --api-key $OPENROUTER_API_KEY
```

```bash theme={null}
agentgg scan ./src --provider openrouter -o ./out
```

## Switch the default provider

The config holds every provider you set up, and marks one of them the default. A
scan uses the default unless you override it for that run.

```bash theme={null}
agentgg config
```

This prints the default, every configured provider, and its model. Secrets are
masked.

```bash theme={null}
agentgg config --provider openai
agentgg config --provider openai --model <model>
```

The first command makes `openai` the default. The second sets the model for that
provider. `--model` needs `--provider`.

<Info>
  `agentgg config` only switches between providers you already set up, and it
  changes no credentials. To add a provider, run `agentgg init`, which also makes
  that provider the default.
</Info>

## One-off credentials

Pass these flags to `agentgg scan` to run once with a different provider or credential. The CLI does not save these values to `~/.agentgg/config.json`.

| Flag            | Accepted by                   | Sets                                                                                                     |
| --------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------- |
| `--provider`    | All six providers             | The provider for this run. It overrides the saved default.                                               |
| `--api-key`     | Anthropic, OpenAI, OpenRouter | The API key. For Anthropic, it also accepts an OAuth token.                                              |
| `--oauth-token` | Anthropic                     | An OAuth token from a Claude Pro or Max plan.                                                            |
| `--base-url`    | Ollama                        | The local server URL.                                                                                    |
| `--region`      | AWS Bedrock, Google Vertex AI | The region for the active provider. An AWS region for Bedrock, or a publisher region pool for Vertex AI. |
| `--project`     | Google Vertex AI              | The GCP project ID that hosts the Vertex AI endpoint.                                                    |

A flag that does not apply to the active provider is a hard error, not a silent ignore. To change the saved default instead of passing a flag every run, see [Switch the default provider](/cli/providers#switch-the-default-provider).
