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

# guild llm

> Manage LLM credentials and model policies.

Manage LLM credentials and model policies from the CLI. See [LLM settings](/platform/llm-settings) for the full model gateway guide.

## Credentials

List an account's LLM credentials and the access each grants. Use it to find the credential ID that `guild llm policy create` binds to.

```bash theme={null}
guild llm credential list <account>              # List an account's LLM credentials
guild llm credential list <account> --archived   # Show archived credentials instead of live ones
```

| Argument or option  | Description                                     |
| ------------------- | ----------------------------------------------- |
| `<account>`         | Account ID or name. Required.                   |
| `--limit <number>`  | Number of results to return.                    |
| `--offset <number>` | Offset for pagination.                          |
| `--archived`        | Show archived credentials instead of live ones. |

The output has one row per credential, ending with the credential UUID to pass to `guild llm policy create --credential`.

## Policies

View and create model policies for a workspace, agent, or workspace-agent target. A policy binds a credential access to a target with an optional model allowlist.

```bash theme={null}
guild llm policy list <account>                                              # List an account's model policies
guild llm policy list <account> --target-id <id>                             # Show only one target's rules
guild llm policy create --credential <id> --target-id <id>                   # Allow all models
guild llm policy create --credential <id> --target-id <id> --models "haiku-*,sonnet-*"  # Restrict models
```

| Command                                                                                                      | Description                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `guild llm policy list <account>`                                                                            | List an account's model policies. Add `--target-id <id>` to show only the rules on one workspace, agent, or workspace-agent.                                                                                                                                                                                                    |
| `guild llm policy create --credential <id> [--publisher <publisher>] --target-id <id> [--models <patterns>]` | Create a policy. `--credential` is the LLM credential ID. `--publisher` names the model publisher on it (case-insensitive, e.g. `ANTHROPIC`); omit it when the credential serves a single publisher and Guild infers it. Omit `--models` to allow all models; pass comma-separated globs (e.g. `haiku-*,sonnet-*`) to restrict. |
