[Integrations](https://spiral.ai/integrations) › [Gemini](https://spiral.ai/integrations/gemini) › [Qwen4 Max](https://spiral.ai/integrations/gemini/qwen4-max)

# How to Use Qwen4 Max in Gemini

Qwen4 Max is built for coding, office work, front-end design, and tasks that require several reasoning steps. Its one-million-token context supports analysis across long documents and large codebases.

|  |  |
| --- | --- |
| Model | Qwen4 Max |
| Available through | OpenRouter |
| Category | LLM |
| Price | Up to $0.02283 per run at the default inputs. $1.8525 per 1M input tokens, $5.5575 per 1M output tokens. |
| Returns | text, json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Qwen4 Max in Gemini

- Use Qwen4 Max to compare the two specifications pasted above. Return a table of conflicting requirements, their section references, and the questions needed to resolve them.
- Use Qwen4 Max with deeper thinking to compare the three launch plans above. Check each against the staffing and deadline constraints, then recommend one in no more than 500 words.
- Use Qwen4 Max to extract the customer requests from the pasted messages. Return JSON with customer, request, deadline, and supporting quote; use null when a detail is missing.
- Use Qwen4 Max to turn the notes above into a decision brief. Separate agreed decisions, proposed actions, and open questions, and include an owner only when the notes name one.
- Use Qwen4 Max with more varied wording to draft three opening paragraphs for the announcement above. Follow the supplied example's tone and keep each version under 80 words.

## How to set up Qwen4 Max in Gemini

Pick the way that suits you. Each takes about two minutes.

### Use the Gemini connector

1. **Open Connected Apps**: On your computer, go to gemini.google.com. At the bottom, click Settings › Connected Apps. If you don't see Connected Apps, click Personal Intelligence first, then Connected Apps.

2. **Add Spiral as a custom app**: Under Custom apps, click Add a custom app and paste this MCP server URL:

```text
https://api.spiral.ai/mcp
```

3. **Sign in to Spiral and approve**: Follow the on-screen instructions. Spiral opens: sign in, pick the organization and click Authorize. No API key.

### Use the Spiral skill

1. **Send Gemini this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Qwen4 Max**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openrouter",
    "model": "qwen/qwen4-max",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    }
  }'
```

Then paste one of the prompts above: Gemini finds Qwen4 Max on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/gemini

## Qwen4 Max tools and prices

- [Qwen: Qwen4 Max](https://spiral.ai/tools/openrouter/qwen/qwen4-max) (OpenRouter): Up to $0.02283 per run at the default inputs. $1.8525 per 1M input tokens, $5.5575 per 1M output tokens.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| seed |  | — |  |
| stop |  | — |  |
| tools |  | — |  |
| top_k | 0 to … | — |  |
| top_p | 0 to 1 | — |  |
| logprobs |  | — |  |

## What can you do with Qwen4 Max in Gemini?

Turn lengthy material supplied in the conversation into comparisons, decisions, and clear drafts with Qwen4 Max. Give it a defined deliverable and an example so the result matches the detail you need.

### Trace a bug across modules

Ask Qwen4 Max to follow a failing request through related code, identify the cause, and propose a focused fix with a regression test.

### Plan a codebase migration

Have Qwen4 Max compare existing interfaces with the target design and produce an ordered migration plan with dependencies and acceptance checks.

### Build a front end from requirements

Give Qwen4 Max a written interface brief covering content, interactions, accessibility, and screen sizes, then request the implementation.

### Compare lengthy specifications

Use Qwen4 Max to compare supplied specifications, identify conflicting requirements, and cite the relevant sections in a decision table.

### Extract support ticket details

Ask Qwen4 Max to turn ticket text into JSON with a defined set of keys, using null for missing details and examples to establish the format.

### Prepare an operational brief

Have Qwen4 Max combine supplied updates into a concise brief covering decisions, owners, deadlines, and unresolved questions.

### Analyze a multi-step decision

Ask Qwen4 Max to compare options against supplied constraints, work through dependencies, and explain the evidence behind a recommendation.

## Overview

- [OpenRouter](https://spiral.ai/providers/openrouter)
- [All Gemini guides](https://spiral.ai/integrations/gemini)

## Qwen4 Max in other agents

- [Amp](https://spiral.ai/integrations/amp/qwen4-max)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/qwen4-max)
- [Claude](https://spiral.ai/integrations/claude-desktop/qwen4-max)
- [Claude Code](https://spiral.ai/integrations/claude-code/qwen4-max)
- [Cline](https://spiral.ai/integrations/cline/qwen4-max)
- [Codex](https://spiral.ai/integrations/codex/qwen4-max)
- [Cursor](https://spiral.ai/integrations/cursor/qwen4-max)
- [Devin](https://spiral.ai/integrations/devin/qwen4-max)
- [dots](https://spiral.ai/integrations/dots/qwen4-max)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/qwen4-max)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/qwen4-max)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/qwen4-max)
- [goose](https://spiral.ai/integrations/goose/qwen4-max)
- [Grok](https://spiral.ai/integrations/grok/qwen4-max)
- [Grok Build](https://spiral.ai/integrations/grok-build/qwen4-max)
- [Hermes](https://spiral.ai/integrations/hermes/qwen4-max)
- [Instinct](https://spiral.ai/integrations/instinct/qwen4-max)
- [Manus](https://spiral.ai/integrations/manus/qwen4-max)
- [Muse](https://spiral.ai/integrations/muse/qwen4-max)
- [Muse Code](https://spiral.ai/integrations/muse-code/qwen4-max)
- [n8n](https://spiral.ai/integrations/n8n/qwen4-max)
- [Notion](https://spiral.ai/integrations/notion/qwen4-max)
- [OpenClaw](https://spiral.ai/integrations/openclaw/qwen4-max)
- [opencode](https://spiral.ai/integrations/opencode/qwen4-max)
- [Perplexity](https://spiral.ai/integrations/perplexity/qwen4-max)
- [Raycast](https://spiral.ai/integrations/raycast/qwen4-max)
- [VS Code](https://spiral.ai/integrations/vscode/qwen4-max)
- [Windsurf](https://spiral.ai/integrations/windsurf/qwen4-max)
- [Zapier](https://spiral.ai/integrations/zapier/qwen4-max)

## More Gemini guides

- [Qwen3.8 Omni Flash](https://spiral.ai/integrations/gemini/qwen3-8-omni-flash)
- [ReMM SLERP 13B](https://spiral.ai/integrations/gemini/remm-slerp-13b)
- [Qwen3.8 Max Prime](https://spiral.ai/integrations/gemini/qwen3-8-max-prime)
- [Reka Edge](https://spiral.ai/integrations/gemini/reka-edge)
- [Qwen3.8 Max (0902) (batch)](https://spiral.ai/integrations/gemini/qwen3-8-max-0902-batch)
- [Reka Flash 3](https://spiral.ai/integrations/gemini/reka-flash-3)

## Questions about Qwen4 Max in Gemini

**Can Gemini use Qwen4 Max?**

Yes. Add Spiral to Gemini as an MCP server, and Gemini can find and run Qwen4 Max like any built-in tool.

**How much does Qwen4 Max cost in Gemini?**

Up to $0.02283 per run at the default inputs. $1.8525 per 1M input tokens, $5.5575 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Gemini plan is separate.

**Do I need an OpenRouter account to use Qwen4 Max in Gemini?**

No. Spiral runs Qwen4 Max on its own OpenRouter account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Qwen4 Max in Gemini?**

About two minutes: open Connected Apps, then add Spiral as a custom app, then sign in to Spiral and approve.

**Does Gemini wait while Qwen4 Max runs?**

Qwen4 Max runs in the background. Gemini starts the run, checks on it and gives you the text, json when it's ready.

**What is Qwen4 Max good at?**

Qwen4 Max is designed for coding, office work, front-end design, and complex agent tasks. Useful requests include tracing a bug across several modules or turning detailed requirements into an implementation plan.

**How much context can Qwen4 Max handle?**

The maker documents a one-million-token context window. That makes long document comparisons and analysis across large codebases practical uses.

**How long can Qwen4 Max's answers be?**

The maker lists up to 131,072 output tokens without thinking. Its documented thinking-mode limit is 262,144 tokens shared between reasoning and the final answer, so that number does not describe answer length alone.

**When is deeper thinking useful?**

Use it for tasks that require choosing tools, interpreting results, and deciding what to do next. The maker cautions that the overhead may not be worthwhile for a simple task involving one tool.

**Does valid JSON guarantee consistent output?**

No. JSON Object mode can return valid JSON while changing key names or value types; the maker recommends JSON Schema mode when the structure must stay fixed.

