> ## 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 Qwen models in Guild agents under policy

> Call Alibaba's Qwen models from Guild agents through AWS Bedrock, OpenRouter, or Fireworks AI, with model policies on every workspace and agent.

Integrations · Qwen

Guild agents call Alibaba's Qwen models through `task.llm`, using a credential for AWS Bedrock, OpenRouter, or Fireworks AI. 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 Qwen.

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

## Pick the provider that has your Qwen model

Qwen models reach Guild only through third-party inference providers, and each one carries a different set. Bedrock is the only provider with the default, `qwen3-next-80b-a3b`. OpenRouter serves the `qwen/` namespace, and Fireworks AI serves the Qwen 3.8 models.

## How it works

**1. Add a credential**

In **Access & setup > Models & providers**, click **Add API key** and choose AWS Bedrock, OpenRouter, or Fireworks AI. Check **Alibaba** under **Models**.

**2. Write a model policy**

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

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

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

## Every Qwen 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 Qwen 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 Qwen models on Guild

| | |
| - | - |
| Name under **Models** in the credential form | Alibaba |
| `provider` in `llmPreferences` | `"alibaba"` |
| Default model | `qwen3-next-80b-a3b` |
| Managed access | No. Add your own credential (BYOK). |

## Inference providers

Qwen models are served only through third-party inference providers, not a Qwen API.

| Provider | Notes |
| - | - |
| [AWS Bedrock](/platform/providers/aws-bedrock) | The only provider with `qwen3-next-80b-a3b`, the default. Region availability varies by model. |
| [OpenRouter](/platform/providers/openrouter) | Served under OpenRouter's `qwen/` namespace. It has no plain `qwen3-next-80b-a3b`, so choose another default, such as `qwen3-next-80b-a3b-instruct` or `qwen3-coder`. |
| [Fireworks AI](/platform/providers/fireworks) | Serves `qwen3.8-max` and `qwen3.8-2.4t-a95b` only. |

Write the canonical model name, such as `qwen3-next-80b-a3b`, everywhere in Guild. Guild maps it to each provider's own model ID.

## Models

Guild prices and recognizes these Qwen 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 |
| - | - |
| `qwen3-next-80b-a3b` | The default. Served by Bedrock. |
| `qwen3-coder-480b-a35b` | Served by Bedrock. |
| `qwen3-coder-next` | Served by Bedrock. |
| `qwen3-32b` | Served by Bedrock. |
| `qwen3.8-max` | Served by Fireworks AI. |
| `qwen3.8-2.4t-a95b` | Served by Fireworks AI. |

## Set up Qwen

Guild has no managed key for Qwen. To use Qwen models, add a credential for a provider that serves them. 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 Alibaba**

Under **Models**, check **Alibaba**. Keep `qwen3-next-80b-a3b` as its default model or enter another from the list above. Then click **Add Key**. On [Fireworks AI](/platform/providers/fireworks), pick a model from its list, because the pre-filled default isn't available there.

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

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

## Use it from an agent

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

```typescript theme={null}
const result = await task.llm.generateText({
  prompt: "Summarize this text...",
  llmPreferences: [
    { provider: "alibaba", model: "qwen3-coder-480b-a35b" },
    { provider: "alibaba" },
  ],
})
```

The first entry asks for `qwen3-coder-480b-a35b`. 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).

> [!NOTE]
>
> The `"alibaba"` provider value needs `@guildai/agents-sdk` 0.7.6 or later.

## Frequently asked questions

> **Can I use Qwen with Guild's managed tokens?**
>
> No. Guild has no managed key for Qwen. Add a credential for a provider that serves it, which switches the account to bring your own key (BYOK).

> **Why is the provider value alibaba rather than qwen?**
>
> Guild names publishers, not model families. The credential form lists Qwen under **Alibaba**, and `llmPreferences` uses `"alibaba"`, which needs `@guildai/agents-sdk` 0.7.6 or later.

> **Does OpenRouter serve the default Qwen model?**
>
> No. OpenRouter has no plain `qwen3-next-80b-a3b`. Choose another default, such as `qwen3-next-80b-a3b-instruct` or `qwen3-coder`.

> **Which Qwen models are on Fireworks AI?**
>
> Only `qwen3.8-max` and `qwen3.8-2.4t-a95b`. Replace the pre-filled default with one of them before you save.

## Put a governed agent on Qwen this week

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

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

## Related

**Also runs on Guild:** [DeepSeek](/integrations/deepseek) · [Moonshot AI](/integrations/moonshot) · [AWS Bedrock](/integrations/aws-bedrock) · [OpenRouter](/integrations/openrouter)

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