batch-api
Fungsinya
Skill ini menyiapkan rencana untuk mengubah banyak file dalam satu langkah, misalnya menerjemahkan atau menulis ulang, lalu mengirimkannya ke layanan batch dengan harga setengah dari harga realtime. Hasilnya tiba nanti sebagai file baru. Ditujukan untuk orang yang bisa menunggu berjam-jam demi pekerjaan massal yang lebih murah.
Kapan dipakai
- โSaat Anda perlu perubahan giliran tunggal yang sama diterapkan pada banyak file dan bisa menunggu berjam-jam.
- โKetika Anda ingin menerjemahkan, menulis ulang, atau mengekstrak konten dari sekumpulan besar file dengan biaya lebih rendah.
- โSaat Anda secara eksplisit menginginkan harga batch dan bukan run realtime.
Link skill
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/batch-api/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya ingin menerjemahkan semua file deskripsi produk saya ke bahasa Spanyol dengan opsi batch yang lebih murah, dan saya bisa menunggu hasilnya.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menyiapkan file rencana yang menjelaskan file dan transformasinya, lalu sebuah perintah mengirimkan pekerjaan. Agent tidak menulis permintaannya sendiri, dan hasilnya kembali sebagai file baru.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Seberapa murah?
Layanan batch menagih permintaan ini dengan setengah harga daftar realtime, tanpa manfaat cache konteks.
Berapa lama satu pekerjaan berjalan?
Pekerjaan bisa memakan waktu puluhan menit hingga berjam-jam, dengan jendela penyelesaian 24 jam atau lebih.
Apa yang terjadi jika perintah batch gagal?
Agent melaporkan apa yang terjadi lalu berhenti. Ia tidak diam-diam mengerjakannya dengan harga realtime penuh.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 29k
- Peringkat
- #9776
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
codegraph
29kMembantu agent Anda menganalisis kodebase yang sudah diindeks melalui grafik pemanggilan, dependensi, kode mati, titik panas, dan pencarian semantik.
qwen-code-claw
29kMembantu agent Anda menyerahkan tugas coding ke Qwen Code, seperti memahami codebase, memperbaiki bug, merapikan kode, atau membuat proyek baru.
structured-debugging
29kMengajari agent Anda men-debug bug sulit secara bertahap: menyusun hipotesis, menguji, dan menemukan penyebab asli sebelum memperbaiki.
tmux-real-user-testing
29kMembantu agent Anda menguji aplikasi terminal seperti pengguna sungguhan di dalam tmux, dengan log yang mudah dibaca dan cuplikan layar tiap aksi.
Skill serupa
knowledge-automation
394kMembantu agent Anda mengatur tugas terjadwal yang memasukkan konten baru ke Knowledge vault Anda secara rutin, lalu memastikan tugas itu berjalan.
knowledge-source-ingest
394kMembantu agent Anda menjaga Knowledge vault tetap mutakhir dengan item baru dari chat, feed, atau kotak surat, tanpa menambahkan ulang yang sudah ada.
benchmark
280kMembantu agent Anda mengukur kecepatan dan performa kode. Berguna untuk memastikan semuanya cepat dan menemukan penyebab kelambatan.