> ## 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.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Run Claude models in Guild agents under policy

> Call Anthropic's Claude models from Guild agents with managed access or your own key, and choose which workspaces and agents can use each one.

Integrations · Anthropic

Guild agents call Anthropic's Claude models through `task.llm`, with no API key in agent code. Guild holds the credential server-side, checks your model policies on every call, and attributes spend to the workspace, agent, and user that made it.

> **[Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)**
>
> See how teams govern agents that use Anthropic.

> **[Start free](https://app.guild.ai)**
>
> Connect Anthropic and scope your first agent.

## One model name, three ways to reach it

Write `claude-sonnet-4-6` once, in a policy or in `llmPreferences`. Guild sends it to the Anthropic API, AWS Bedrock, or OpenRouter, depending on which credential your policies select, and maps it to that provider's own model ID. Prompt caching is added for you unless your request sets its own cache breakpoints.

## How it works

**1. Add a credential**

In **Access & setup > Models & providers**, click **Add API key** and choose a provider that serves Claude models. Check **Anthropic** under **Models**. On a managed account, you can skip this while Guild holds a managed Anthropic key.

**2. Write a model policy**

Bind the credential's Anthropic access to the account, a workspace, or an agent, and list the models it may call, such as `claude-sonnet-*`.

**3. Call it from task.llm**

Name `"anthropic"` in `llmPreferences`, or leave preferences out and let your policies choose. Guild resolves the credential at runtime.

## Every Claude call goes through your policies

Agents never hold the key. Guild stores the credential server-side and shows only a masked value, so you can rotate it without touching agent code or the [model policies](/platform/llm-settings#model-policies) bound to it. Policies are an allowlist: a workspace, agent, or installed agent can call a Claude model only if a rule allows it. Set a [daily token limit](/platform/llm-settings#daily-token-limit) to cap spend, and see each call by workspace, agent, and user in [Usage](/insights/usage).

A raw API key in an agent's environment reaches every model the key can. A policy reaches only the models you name.

## About Anthropic models on Guild

| | |
| - | - |
| Name under **Models** in the credential form | Anthropic |
| `provider` in `llmPreferences` | `"anthropic"` |
| Default model | `claude-sonnet-4-6` |
| Managed access | Yes, when Guild holds a managed key |

## Inference providers

You can reach these models through the Anthropic API itself or through a third-party provider.

| Provider | Notes |
| - | - |
| Anthropic | The publisher's own API. Available on every account. |
| [AWS Bedrock](/platform/providers/aws-bedrock) | Serves current Claude models in all four US regions. |
| [OpenRouter](/platform/providers/openrouter) | Served under OpenRouter's `anthropic/` namespace. |

Write the canonical model name, such as `claude-sonnet-4-6`, everywhere in Guild. Guild maps it to each provider's own model ID.

## Models

Guild prices and recognizes these Anthropic model IDs. A policy or preference can also name any other model your credential can reach. Third-party providers route more models than this list, and their catalogs change; see each provider's page for what it serves.

| Model | Notes |
| - | - |
| `claude-opus-5-5` | |
| `claude-opus-5` | |
| `claude-sonnet-5` | Also matched as `claude-sonnet-5-20260115`. |
| `claude-sonnet-4-6` | The default. |
| `claude-sonnet-4-5-20250929` | |
| `claude-haiku-4-5` | Also matched as `claude-haiku-4-5-20251001`. |
| `claude-fable-5` | |
| `claude-mythos-5` | |
| `claude-opus-4-8` | |
| `claude-opus-4-7` | |
| `claude-opus-4-6` | |
| `claude-opus-4-5` | |
| `claude-opus-4-1` | |
| `claude-opus-4` | |

## Set up Anthropic

On a managed account, agents can use Anthropic models without a credential, as long as Guild holds a managed key for Anthropic. To use your own Anthropic account instead, add a credential. Adding your first credential switches the whole account to bring your own key (BYOK).

**1. Open Models & providers**

Click **Access & setup** in the left nav, then **Models & providers**. In an organization, only admins can open it.

**2. Add a credential**

Click **Add API key** and choose an inference provider from the table above.

**3. Enter the provider's secret**

Give the credential a **Name** and paste your provider's **API key**. [AWS Bedrock](/platform/providers/aws-bedrock) asks for an IAM role and region instead.

**4. Choose Anthropic**

Under **Models**, check **Anthropic**. Keep `claude-sonnet-4-6` as its default model or enter another from the list above. Then click **Add Key**.

To control which workspaces and agents can use Anthropic models, add a [model policy](/platform/llm-settings#model-policies) for the credential. For example, `--models "claude-sonnet-*"` limits a policy to matching models:

```bash theme={null}
guild llm policy create --credential <credential-id> --publisher ANTHROPIC --target-id <workspace-or-agent-id> --models "claude-sonnet-*"
```

## Use it from an agent

Agent code never names a credential. Guild resolves the call against the workspace owner's settings. To ask for Anthropic explicitly, put it in `llmPreferences`:

```typescript theme={null}
const result = await task.llm.generateText({
  prompt: "Summarize this text...",
  llmPreferences: [
    { provider: "anthropic", model: "claude-opus-5-5" },
    { provider: "anthropic" },
  ],
})
```

The first entry asks for `claude-opus-5-5`. The second falls back to the default model of the matching policy. Preferences are strict: if no credential or policy allows any of them, the call fails rather than using another publisher. See [LLM preferences](/guide/llms#llm-preferences).

## Notes

* Guild adds prompt caching to Anthropic calls automatically, unless your request sets its own cache breakpoints.
* When a Claude model uses adaptive thinking, Guild requests summarized thinking so the session can show reasoning progress.
* The Claude Code runtime driver calls the Anthropic API directly through the runtime, so it needs an Anthropic credential or managed Anthropic access.
* On Bedrock, Guild passes only the `anthropic-beta` flags Bedrock accepts, and drops the rest.

## Frequently asked questions

> **Can Guild agents use Claude without my own Anthropic key?**
>
> Yes, on a managed account, when Guild holds a managed key for Anthropic. Usage then draws from your Guild tokens balance. Adding any credential switches the whole account to bring your own key (BYOK).

> **Can I run Claude through AWS Bedrock instead of the Anthropic API?**
>
> Yes. Add an [AWS Bedrock](/integrations/aws-bedrock) credential and check **Anthropic** under **Models**. Bedrock serves current Claude models in all four supported US regions.

> **Will Guild switch to another publisher if no policy allows Claude?**
>
> No. Preferences are strict. If no credential or policy allows any of an agent's preferences, the call fails rather than quietly using another publisher's model.

> **What does the Claude Code runtime need?**
>
> An Anthropic credential or managed Anthropic access. The Claude Code runtime driver calls the Anthropic API directly through the runtime.

## Put a governed agent on Anthropic this week

> **[Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)**
>
> See how teams govern agents that use Anthropic.

> **[Start free](https://app.guild.ai)**
>
> Connect Anthropic and scope your first agent.

## Related

**Also runs on Guild:** [OpenAI](/integrations/openai) · [Gemini](/integrations/gemini) · [AWS Bedrock](/integrations/aws-bedrock) · [OpenRouter](/integrations/openrouter)

**Read:** Docs: [Models & providers](/platform/llm-settings) · [LLMs](/guide/llms) · [Usage](/insights/usage)
