---
title: "Qwen3 Coder 30B A3B Instruct"
description: "An open-weight, text-only coding model from Qwen with low prices. It has no benchmark results, so its profile rests on specifications and price."
canonical: https://pydantic.dev/models/list/qwen3-coder-30b-a3b-instruct/
---

# Qwen3 Coder 30B A3B Instruct

> An open-weight, text-only coding model from Qwen with low prices. It has no benchmark results, so its profile rests on specifications and price.
>
> Markdown copy of [https://pydantic.dev/models/list/qwen3-coder-30b-a3b-instruct/](https://pydantic.dev/models/list/qwen3-coder-30b-a3b-instruct/). Index for agents: [llms.txt](https://pydantic.dev/models/llms.txt)

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: [select.md](https://pydantic.dev/models/select.md)
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: [usage.md](https://pydantic.dev/models/usage.md)

Use it with Pydantic AI as `gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0`.

## Spec sheet

- **Type:** writes text
- **Family:** Qwen
- **Released:** 31 Jul 2025
- **Weights:** open
- **Context window:** 256,000 tokens
- **Largest response:** 65,536 tokens
- **Accepts:** text
- **Tool calling:** yes
- **Knowledge cutoff:** unknown
- **Intelligence index:** not enough benchmark results yet
- **Scores updated:** unknown
- **Price:** $0.15 input, $0.6 output, $0.26 blended per 1M tokens
- **Index points per $:** – (rank –)
- **Speed:** 127 tokens/sec (rank 24)
- **Popularity:** rank 147 of 222 by usage
- **Pydantic AI Gateway:** built in

## Benchmarks


No results yet on the benchmarks we track.

## Providers and prices

US dollars per million tokens.

| Provider    | Gateway  | Pydantic AI string                              | Input | Cached input | Output |
| ----------- | -------- | ----------------------------------------------- | ----- | ------------ | ------ |
| AWS Bedrock | built in | `gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0` | $0.15 | –            | $0.6   |
| OVHcloud    | BYOK     | `ovhcloud:Qwen3-Coder-30B-A3B-Instruct`         | $0.07 | –            | $0.26  |
| OpenRouter  | BYOK     | `openrouter:qwen/qwen3-coder-30b-a3b-instruct`  | $0.07 | –            | $0.28  |

## Use Qwen3 Coder 30B A3B Instruct with Pydantic AI

### hello.py

Ask Qwen3 Coder 30B A3B Instruct a question with a Pydantic AI agent and print the answer. Run it with uv run hello.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0', instructions='Be concise, reply with one sentence.')

result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
```

### structured_output.py

Get validated, typed output from Qwen3 Coder 30B A3B Instruct by giving the agent a Pydantic model. Run it with uv run structured_output.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic import BaseModel
from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'


class CityLocation(BaseModel):
    city: str
    country: str


agent = Agent('gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0', output_type=CityLocation)

result = agent.run_sync('Where were the olympics held in 2012?')
print(result.output)
#> city='London' country='United Kingdom'
```

### tools.py

Give Qwen3 Coder 30B A3B Instruct two tools to call, one of which reads the agent's dependencies. Run it with uv run tools.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os
import random

from pydantic_ai import Agent, RunContext

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent(
    'gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0',
    deps_type=str,
    instructions="You're a dice game, roll the die and see if it matches the user's guess.",
)


@agent.tool_plain
def roll_dice() -> str:
    """Roll a six-sided die and return the result."""
    return str(random.randint(1, 6))


@agent.tool
def get_player_name(ctx: RunContext[str]) -> str:
    """Get the player's name."""
    return ctx.deps


result = agent.run_sync('My guess is 4', deps='Anne')
print(result.output)
```

### streaming.py

Stream Qwen3 Coder 30B A3B Instruct's reply to the terminal as it is generated. Run it with uv run streaming.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import asyncio
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0')


async def main():
    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:
        async for text in response.stream_text(delta=True):
            print(text, end='', flush=True)


asyncio.run(main())
```

### pax.sh

Code with Qwen3 Coder 30B A3B Instruct in your terminal using Pax, the Pydantic AI coding agent.

```sh
export PYDANTIC_AI_GATEWAY_API_KEY='...'

uv run --from pydantic-ai-pax pax -m 'gateway/bedrock:qwen.qwen3-coder-30b-a3b-v1:0'
```

### ai_sdk.ts

Call Qwen3 Coder 30B A3B Instruct from TypeScript with the Vercel AI SDK, through Pydantic AI Gateway.

```ts
// npm install ai @ai-sdk/amazon-bedrock
import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock'
import { generateText } from 'ai'

process.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'

const bedrock = createAmazonBedrock({
  baseURL: 'https://gateway.pydantic.dev/proxy/bedrock',
  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,
})

const { text } = await generateText({
  model: bedrock('qwen.qwen3-coder-30b-a3b-v1:0'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About Qwen3 Coder 30B A3B Instruct

Qwen3 Coder 30B A3B Instruct costs $0.15 per million input tokens and $0.6 per million output tokens and has a 256k token context window.

Qwen3 Coder 30B A3B Instruct is an open-weight model from the Qwen family, released in July 2025. It accepts text input only and offers a 256k token context window, with responses up to 65k tokens. Tool calling and structured output are supported, but reasoning mode is not offered.

Price is the main point for a buyer. At $0.15 per million input tokens and $0.60 per million output tokens, its blended price of about $0.26 sits well below the registry median of $0.80, and its price rank is 41st of 222.

The registry holds no benchmark results for this model, so its coding or reasoning quality cannot be compared with other models. It is available through AWS Bedrock, OVHcloud and OpenRouter. Developers should test it on their own tasks before relying on it.

**Strengths**

- Blended price $0.26 per million tokens, well below the $0.80 median
- Price rank 41st of 222, among the cheaper models in the registry
- 256k token context window
- Supports tool calling and structured output

**Weaknesses**

- No benchmark results recorded, so capability cannot be compared
- Text input only and no reasoning mode
- Available from three providers, with popularity 147th of 222

**Best for:** Low-cost coding and tool-calling agents that need long context and structured output, where benchmark evidence is not required.

Prices come from [genai-prices](https://github.com/pydantic/genai-prices), in US dollars per million tokens. Benchmark scores come from Epoch AI and LMArena (CC BY 4.0), Browser Use, our own Pydantic AI benchmarks (CC BY 4.0), and, for decision models, Artificial Analysis and the Jev Decision Index; the index and its sources are described in [the methodology](https://pydantic.dev/models/methodology.md). Data built 2026-12-04. This model from the API: `https://pydantic.dev/models/api/models/qwen3-coder-30b-a3b-instruct`. Compare it with others: `https://pydantic.dev/models/api/models?slug=qwen3-coder-30b-a3b-instruct,<other slug>`
