batch-api

batch-api is a skill for Claude Code from QwenLM/qwen-code. It costs 51 tokens per session (2,141 once invoked), scanned A, original, Apache-2.0.

A workflow for preparing a many-file translation, rewriting, or extraction job for the asynchronous DashScope Batch API. The API processes submitted requests later, trading a longer wait for lower request pricing.

In plain words
What is it for?
Use it with `/batch-api` to turn a large transformation task into a plan file for the batch executor. Results arrive as new files after the remote job completes.
Why use it?
It prevents an explicitly chosen batch job from silently being performed in real time instead. It also stops when a batch command fails or the task is unsuitable, rather than switching methods without permission.

Skill for Claude Code ✓ vendor

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it with /batch-api to turn a large transformation task into a plan file for the batch executor. Results arrive as new files after the remote job completes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qwenlm/qwen-code/batch-api
About the project

Qwen Code is an open-source AI coding agent that runs in a terminal and helps developers work with code through language models. It supports multiple model providers and can also be used through IDEs, desktop software, SDKs, and messaging bots.

QwenLM/qwen-code · 28,201 stars · on GitHub · qwenlm.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add QwenLM/qwen-code --skill batch-api
Clone the repo
git clone --depth 1 https://github.com/QwenLM/qwen-code

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for batch-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/qwenlm/qwen-code/batch-api/github.svg)](https://agentmods.dev/skills/qwenlm/qwen-code/batch-api)
Your own site
<a href="https://agentmods.dev/skills/qwenlm/qwen-code/batch-api"><img src="https://agentmods.dev/badge/skills/qwenlm/qwen-code/batch-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for batch-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/qwenlm/qwen-code/batch-api"><img src="https://agentmods.dev/badge/skills/qwenlm/qwen-code/batch-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.02141
Opus 5.5 $0.00020 $0.00856
Sonnet 5 $0.00010 $0.00428
Haiku 4.5 $0.00005 $0.00214

Measured today against content hash a0baeb1fd338, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-28, from the pricing page.

Security

Grade A, and why

batch-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (SKILL.test.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/core/src/skills/bundled/batch-api/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/batch-api — Agent-prepared Batch API workflow

Hard rule for this whole skill: if any qwen batch … command fails, or the task turns out to be unsuitable, report what happened in a few lines and stop (the one exception, a plan-field error from run, is in §4). Never fall back to doing the transform yourself in this session — the user chose the half-price asynchronous path explicitly, and silently doing the work at full realtime price is exactly what they opted out of. Offering it as a choice ("I can do this realtime instead, at full price") is fine; doing it without being asked is not.

The user explicitly chose async batch mode by typing /batch-api. This mode trades latency for price: the provider bills Batch requests at 50% of the realtime list price (with no context-cache benefit), and a job takes tens of minutes to hours to finish (completion window 24h or more). Your job is to turn the user's task into a small plan file that the deterministic executor (qwen batch run) submits. You never write request JSONL by hand and never call the Batch API yourself.

0. Check readiness before anything else

Run every qwen batch … command with the shell tool as "${QWEN_CODE_CLI:-qwen}" batch … — QWEN_CODE_CLI names the CLI running this session, so a plain qwen on PATH (possibly an older install without these subcommands) is only the fallback. First make sure the CLI you reach has them. Help output never calls a model:

"${QWEN_CODE_CLI:-qwen}" batch --help

If the output does not list batch run <plan>, the qwen it reached is an older install without these subcommands — say so (the session's CLI is not on PATH as qwen) and stop. Do not run any other batch command there: an older CLI treats batch check as a prompt and answers it with a billed model call. Then:

"${QWEN_CODE_CLI:-qwen}" batch check

It proves the credentials, endpoint and Batch route work and shows the model, thinking mode and output limit a run would freeze from the user's current settings — without a billed request. settings.batch.model can select a separate modelProviders entry; its endpoint, envKey and generationConfig are used without changing the conversation model. Do not edit authentication or settings to work around a failed check. If it fails (for example Qwen OAuth, which has no Batch route), relay its message and stop: do not read files or draft a plan the executor cannot submit. Pass its note: lines on to the user.

Read the full file on GitHub · 201 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +2 lines a0baeb1fd338
  2. 3d ago First seen · 199 lines · 51 tokens per session scan A cd51a38b2c8d

Subscribe to this mod's changes

batch-api is a skill published in the GitHub repository QwenLM/qwen-code (28,201 stars, last pushed today), licensed Apache-2.0. It adds 51 tokens to every session and 2,141 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-26.