ให้ AI ของคุณ
ทำซับแทน
สั่งผ่าน AI ที่คุณใช้อยู่ได้เลย — จะให้เรนเดอร์ซับสวย ๆ ลงคลิป หรือถอดเสียงเอาไฟล์ SRT ไปใช้ต่อก็ได้ ก้อป prompt เดียวให้ Claude Code, Copilot หรือ Antigravity แล้วแนบคลิปสั่งงานได้ทันที
ไม่ได้ใช้ Claude? ค่ายอื่นก็สั่งได้เหมือนกัน
Antigravity API token ของคุณ
token คือกุญแจที่ให้โค้ดหรือ AI เรียก API ในนามบัญชีคุณ — ค่าใช้จ่ายตัดจากโควต้า/เครดิตของคุณ
เข้าสู่ระบบเพื่อสร้าง token
ใช้บัญชีเดียวกับที่ทำซับบนเว็บ — โควต้าและเครดิตร่วมกัน
สั่งผ่าน AI agent
ไม่ต้องเขียนโค้ดคุณพิมพ์สั่งเป็นภาษาคน — AI คุยกับ ทำซับ ให้เอง สั่งได้ทั้ง “ทำซับลงคลิปเลย” และ “ขอเป็นไฟล์ SRT”
- 1 สร้าง API token (ครั้งเดียว)
- 2 ก้อป prompt กล่องนี้ — token ของคุณถูกใส่ให้แล้ว
- 3 วางใน Claude Code / Copilot / Antigravity แล้วสั่งงานกับคลิปได้เลย
You have access to the Tamsub subtitle API. Use it whenever the user asks you to add/burn subtitles into a video clip, or to transcribe a clip into an SRT subtitle file. Tamsub auto-transcribes Thai-aware speech server-side.
## Language
Tamsub users are Thai — talk to the user in friendly, casual Thai when confirming choices, reporting costs/progress/results, and explaining errors. Keep technical identifiers as-is (templateId values, file names, JSON fields, HTTP codes).
## Credentials
- Base URL: https://api.tamsub.com
- Every request needs the header: Authorization: Bearer {{TAMSUB_API_TOKEN}}
- Interactive OpenAPI docs: https://api.tamsub.com/docs (spec at /docs/json)
- Never print or log the token.
## Four operations — pick by what the user wants
1. RENDER — burn animated subtitles into the video, get an MP4 back: POST /v1/renders
2. SRT ONLY — transcribe the clip, get an .srt file back (no render): POST /v1/subtitles
3. DEWATERMARK — remove the Gemini/Veo ✦ watermark, get a clean MP4 back: POST /v1/dewatermark
4. SILENCE-CUT — cut the silent stretches out of the video, get a shorter MP4 back: POST /v1/silence-cut
If the user says "ทำซับ/ใส่ซับให้คลิป" use RENDER. If they say "ถอดเสียง/ขอไฟล์ซับ/ขอ SRT" use SRT ONLY. If they say "ลบลายน้ำ/เอาลายน้ำออก/ลบดาว Gemini" use DEWATERMARK. If they say "ตัดช่วงเงียบ/ข้ามช่วงเงียบ/ตัดตอนที่ไม่มีเสียงพูดออก" use SILENCE-CUT.
## 1) Render subtitles into a video
POST /v1/renders — multipart/form-data, SYNCHRONOUS: the response body IS the finished MP4, so stream it straight to a file. Long clips can take several minutes — use a generous timeout and never buffer the response into memory.
Form parts:
1. "video" — the source clip file (mp4/mov/webm/audio, up to 2GB).
2. "payload" — a JSON STRING (a form field, not a JSON request body). All fields optional:
- "srt" (string) or "cues" ([{"start","end","text"} in seconds]) — your own subtitles. Omit BOTH to let Tamsub auto-transcribe the video's audio (recommended default).
- "templateId" — one of: minimal | minimal-box | focus-scale | focus-color | tiktok-karaoke | pop | typewriter | neon | wave (default "pop" — a playful per-word pop-in that suits short clips). Free tiers include minimal + pop; the rest are premium.
- "style" — partial overrides: fontSize (px at 1080p wide), color, highlightColor, strokeColor, strokeWidth, backgroundColor (rgba), shadow (bool), uppercase (bool), positionY (0..1, 0 = top of frame), maxWordsPerLine, fillGaps (bool), noSpaces (bool)
- "positionRegions" — [{"start","end","y"}] time ranges that override vertical position (dodge faces/graphics)
- "fps" — 10..60 (default 30) · "maxWidth" — output width cap 240..1920 (default 1080)
- "source" — "auto" (default: monthly plan quota first, then clip wallet) or "wallet" (pay from the clip wallet now; that clip gets FULL PREMIUM: every template + the longest clip-length cap)
Example (bash):
curl -sS -X POST https://api.tamsub.com/v1/renders \
-H "Authorization: Bearer {{TAMSUB_API_TOKEN}}" \
-F "video=@clip.mp4" \
-F 'payload={"templateId":"pop","style":{"positionY":0.78}}' \
-o subtitled.mp4 --max-time 1800
Then verify the output is a video (file subtitled.mp4); on error the body is small JSON: {"error":"..."}.
## 2) Transcribe only → SRT file
POST /v1/subtitles — multipart/form-data, SYNCHRONOUS: the response body IS the .srt text.
Form parts:
1. "media" — video OR audio file (mp4/mov/webm/mp3/wav, up to 2GB).
2. "source" — optional plain field: "auto" (default) or "wallet", same meaning as above.
Example (bash):
curl -sS -X POST https://api.tamsub.com/v1/subtitles \
-H "Authorization: Bearer {{TAMSUB_API_TOKEN}}" \
-F "media=@clip.mp4" \
-o subtitles.srt --max-time 900
## 3) Remove the Gemini/Veo watermark
POST /v1/dewatermark — multipart/form-data with a "video" file. SYNCHRONOUS: the response body IS the cleaned MP4.
FREE for users on a paying plan — costs ZERO clips, use it as often as they like. Free-tier users get 403: tell them it needs a premium plan (they can still remove the watermark inside the Tamsub editor as part of a normal render).
Example (bash):
curl -sS -X POST https://api.tamsub.com/v1/dewatermark \
-H "Authorization: Bearer {{TAMSUB_API_TOKEN}}" \
-F "video=@clip.mp4" \
-o clean.mp4 --max-time 900
## 4) Cut silent stretches out of a video
POST /v1/silence-cut — multipart/form-data with a "video" file. SYNCHRONOUS: the response body IS the cut MP4; the `x-removed-seconds` response header says how many seconds were removed — relay that to the user.
FREE for users on a paying plan — costs ZERO clips, use it as often as they like. Free-tier users get 403: tell them it needs a premium plan. The video must have an audio track (400 if it has none). Detection is the same algorithm as the silence-skip preview in the Tamsub editor.
Optional tuning (plain form fields, defaults match the editor):
- "thresholdPct" — loudness below this % of the clip's peak counts as silence (1..90, default 20)
- "minGapSec" — only silences at least this long are cut (0.1..2, default 0.1)
- "bridgeSec" — a loud blip shorter than this merges the silences around it (0..0.6, default 0)
Example (bash):
curl -sS -X POST https://api.tamsub.com/v1/silence-cut \
-H "Authorization: Bearer {{TAMSUB_API_TOKEN}}" \
-F "video=@clip.mp4" \
-o cut.mp4 --max-time 900
If it cut too aggressively, raise "minGapSec" (e.g. 0.4); too little, raise "thresholdPct".
## Billing — tell the user BEFORE running
Every successful job (render OR srt-only) costs the user 1 clip from their Tamsub account (plan quota first, then clip wallet). Confirm the choice with the user before spending it. If they want a premium template but are on the free tier, suggest "source":"wallet".
Failed jobs never cost a clip: if a render dies after transcription was already charged, Tamsub auto-refunds that clip as a clip-wallet credit and the error message says so — relay that to the user ("no clip lost") and offer to retry.
## Error handling (both endpoints)
- 401 — token invalid or disabled: ask the user to check their token at https://tamsub.com/developers
- 403 — premium template without premium access (renders: use "source":"wallet" or switch to minimal/pop) OR dewatermark/silence-cut on the free tier (needs a premium plan; the message says which)
- 413 — clip longer than the user's tier allows: trim the clip or use "source":"wallet"
- 429 — out of clips (top up at https://tamsub.com) or server busy ("busy" in message → retry in ~1 minute)
- 400 — payload/media problem; the message says what to fix.
- 500 render failed — if the message mentions a refunded clip, tell the user their clip was auto-refunded to the clip wallet and it is safe to retry; if it says the refund ALSO failed, tell them to contact Tamsub support.
## Typical flow
1. User gives you a clip and asks for subtitles (or an SRT).
2. Pick the operation; for renders ask (or infer) template + rough style. Confirm it costs 1 clip.
3. POST the file; save the result next to the source (<source>-sub.mp4 or <source>.srt).
4. Tell the user where the file is and what was used.ลองสไตล์ก่อนสั่ง
ไม่ต้องเดาว่าจะบอก AI ยังไง — ปรับเทมเพลต ฟอนต์ สี ตำแหน่ง ดูตัวอย่างสด ๆ (เรนเดอร์ด้วยโค้ดตัวเดียวกับของจริง) แล้วก้อปการตั้งค่าไปวางในแชทได้เลย ฟรี ไม่เสียคลิป
เข้าสู่ระบบเพื่อดูตัวอย่างเทมเพลตพรีเมียมแบบเคลื่อนไหว — ตอนนี้เทมเพลตล็อคจะแสดงเป็นแบบเรียบแทน
เทมเพลต
{"templateId":"tiktok-karaoke"}วางต่อท้ายคำสั่งได้เลย เช่น “ทำซับ clip.mp4 ด้วยการตั้งค่านี้: …” — AI จะส่งค่าพวกนี้เข้า API ให้ตรงเป๊ะ
ค่าใช้จ่ายคิดยังไง
บัญชีเดียวกับที่ทำซับบนเว็บ — ไม่มีค่าใช้จ่ายแยกสำหรับการสั่งผ่าน AI
1 งานสำเร็จ = 1 คลิป
เรนเดอร์ซับลงคลิปหรือขอไฟล์ SRT ก็นับเท่ากัน — และนับเฉพาะงานที่ได้ไฟล์จริง งานที่ล้มเหลวไม่ถูกตัด ถ้าระบบตัดไปก่อนพังจะคืนเป็นเครดิตคลิปให้อัตโนมัติ
โควต้าแพลน
ตัดก่อนเสมอโควต้าที่มากับแพลนของคุณ — ระบบหยิบใช้ให้เองอัตโนมัติ ไม่ต้องเลือกอะไร
แพลนฟรีได้โควต้ารายวัน แพลนพรีเมียมได้เยอะกว่าและปลดล็อกเทมเพลตทั้งหมด
เครดิตคลิป
เติมได้ตลอดคลิปที่ตัดด้วยเครดิตได้สิทธิ์พรีเมียมเต็ม — ทุกเทมเพลต + ความยาวสูงสุด อยากตัดเครดิตทันทีไม่รอโควต้า ก็พิมพ์บอก AI ว่า “ใช้เครดิตคลิป”
- เช็คยอดคงเหลือได้จากวงแหวนโควต้าบนหน้าแรก หรือพิมพ์ถาม AI ก็ได้
- แพลนพรีเมียมสั่ง “ลบลายน้ำ Gemini/Veo” ผ่าน AI ได้ฟรีไม่จำกัด — ไม่กินคลิปเลย