batch-api
Was er macht
Dieser Skill bereitet einen Plan vor, mit dem viele Dateien in einem Schritt verändert werden, etwa übersetzt oder umgeschrieben, und schickt ihn zu einem Batch-Dienst zum halben Echtzeitpreis. Ergebnisse kommen später als neue Dateien. Er ist für Menschen, die stundenlanges Warten bei Massenarbeit für günstiger halten.
Wann du ihn nutzt
- ✓Wenn du dieselbe Einzelturn-Änderung auf viele Dateien anwenden willst und stundenlang auf das Ergebnis warten kannst.
- ✓Wenn du Inhalte über eine große Menge von Dateien günstiger übersetzen, umschreiben oder extrahieren willst.
- ✓Wenn du ausdrücklich die Batch-Preise und keinen Echtzeitlauf willst.
Link zum Skill
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/batch-api/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Ich will alle meine Produktbeschreibungen mit der günstigeren Batch-Option ins Spanische übersetzen, und ich kann auf die Ergebnisse warten.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent erstellt eine Planungsdatei, die die Dateien und die Transformation beschreibt, und ein Befehl sendet den Job dann ab. Die Anfragen schreibt der Agent nicht selbst, und die Ergebnisse kommen als neue Dateien zurück.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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.
1. Decide suitability honestly — this is your main job
Suitable: many independent, single-turn transforms whose input materials are fully available right now. Examples: translate a set of documents under a fixed style guide, rewrite files to a new format, summarize or extract structured data from each file of a set.
Unsuitable:
- Work that needs iterative feedback — debugging, run-test-fix loops, exploratory refactors. The next step there depends on results that do not exist yet.
- Chained tasks where one item's output is another item's input.
- A handful of items, or a task the user needs answered soon. Batch's wait buys nothing there.
If the task is unsuitable, say so in one short paragraph and stop.
2. Prepare lightly
The whole point is saving money, so do not burn the savings in preparation:
- Discover the target files with glob.
- Read only a small sample (2–3 files) to understand structure and edge cases. Do NOT deeply read every file — the executor reads and embeds the full contents mechanically at submission time.
- Draft the shared rules once: terminology, style, format constraints, and the exact output contract. The model that runs the batch sees only your plan — spell out everything it needs, including "return ONLY the complete transformed document, no commentary".
3. Write the plan file
Write one JSON file to .qwen/batch/plans/<slug>.json (<slug> = short
kebab-case task name) with the write_file tool:
{
"version": 1,
"name": "<slug>",
"kind": "document-transform",
"shared": {
"system": "optional role/system prompt",
"instructions": "the shared transform rules, terminology, output contract"
},
"items": [
{
"id": "intro",
"source": "docs/zh/intro.md",
"target": "docs/en/intro.md"
}
]
}
Rules:
idmust match[A-Za-z0-9][A-Za-z0-9_-]{0,59}(1–60 characters) and be unique per item; it becomes part of the provider-sidecustom_id.- Paths are relative to the curr
Häufige Fragen
Wie viel günstiger ist es?
Der Batch-Dienst berechnet diese Anfragen zum halben Echtzeit-Listenpreis, ohne Vorteil durch Kontext-Caching.
Wie lange dauert ein Job?
Jobs können zehn Minuten bis mehrere Stunden dauern, mit einem Abschlussfenster von 24 Stunden oder mehr.
Was passiert, wenn der Batch-Befehl fehlschlägt?
Der Agent berichtet, was passiert ist, und hört auf. Er erledigt die Arbeit nicht stillschweigend zum vollen Echtzeitpreis.
Details
Originalbeschreibung des Autors
Prepare a many-file, single-turn transform (translate, rewrite, extract) as a plan and submit it to the asynchronous, half-price DashScope Batch API; results are delivered as new files hours later. Invoke explicitly with /batch-api.
repo: QwenLM/qwen-code
Beliebtheit
- GitHub-Sterne
- 29k
- Platz im Ranking
- #9776
- Lizenz
- Apache-2.0
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
codegraph
29kHilft deinem Agenten, eine indizierte Codebasis über ihren Aufrufgraphen, Abhängigkeiten, toten Code, Hotspots und semantische Suche zu analysieren.
qwen-code-claw
29kHilft deinem Agenten, Programmieraufgaben an Qwen Code zu übergeben, etwa Code verstehen, Fehler beheben, umbauen oder ein neues Projekt erzeugen.
structured-debugging
29kBringt deinem Agenten bei, schwierige Fehler Schritt für Schritt zu finden: erst eine Hypothese, dann gezielte Prüfung, dann die Reparatur.
tmux-real-user-testing
29kHilft deinem Agenten, eine Terminal-App in tmux wie ein echter Nutzer zu testen, mit lesbarem Protokoll und Bildschirmfotos.
Ähnliche Skills
knowledge-automation
394kHilft deinem Agenten, einen wiederkehrenden Auftrag einzurichten, der regelmäßig neue Inhalte in deinen Knowledge-Vault bringt, und danach zu prüfen, ob er läuft.
knowledge-source-ingest
394kHilft deinem Agenten, den Knowledge-Vault mit neuen Einträgen aus Chat-Kanälen, Feeds oder Postfächern aktuell zu halten, ohne bereits Vorhandenes erneut hinzuzufügen.
benchmark
280kHilft deinem Agenten, die Geschwindigkeit und Performance von Code zu messen. Nützlich, um Tempo sicherzustellen und Bremsen zu finden.