Caption translation
ใช้งานได้Send your timed captions and a language. Get the same lines back translated, in the same order and with the same timings, ready to put on the video.
Caption translation
อินพุต
segmentsThe timed caption lines, each with start, end (seconds) and text.target_languageThe language to translate into.source_languageThe captions' language; leave it out to detect it.$0.00591 per started 1,000 characters.
120 billed characters120 billed characters
1 00:00:00,200 --> 00:00:02,240 สวัสดีและยินดีต้อนรับสู่ร้านกาแฟของเรา 2 00:00:03,040 --> 00:00:05,160 วันนี้เรามีเค้กช็อกโกแลตสดใหม่ 3 00:00:05,880 --> 00:00:06,500 อยากลองชิมไหมครับ?
Language: th
ทำงานอย่างไร
- 01Send the captionsLines with start and end seconds, and a language such as th or ja.
- 02We translate themLine by line, short enough to read.
- 03Get the captionsBilled per 1,000 characters, known up front.
เรียก Caption translation จากโค้ดของคุณ
One endpoint and one key, on the same balance as the playground. The request below is the example's own.
https:/ / api.opennan.com/ v1/ captions/ translationsรับคีย์ API
สร้างคีย์ในคอนโซล คีย์ใช้ยอดเงินเดียวกับส่วนทดลองใช้
สร้างคีย์ส่งคำขอแรก
คำขอเดียวกับที่ส่วนทดลองใช้ส่ง ตั้งค่า OPENNAN_KEY เป็นคีย์ของคุณ
curl https://api.opennan.com/v1/captions/translations \ -H "Authorization: Bearer $OPENNAN_KEY" \ -H "Content-Type: application/json" \ -d '{"segments":[{"start":0.2,"end":2.24,"text":"Hello and welcome to our coffee shop."},{"start":3.04,"end":5.16,"text":"Today we have fresh chocolate cakes."},{"start":5.88,"end":6.5,"text":"Want to try them?"}],"target_language":"th","source_language":"en"}' # Then poll until "status" is "succeeded" or "failed": curl https://api.opennan.com/v1/tasks/<task id> -H "Authorization: Bearer $OPENNAN_KEY"ตรวจสถานะงาน
การเรียกจะตอบกลับทันทีด้วย id งาน ตรวจงานนั้นจนกว่าจะเสร็จ:
GEThttps:// api.opennan.com/ v1/ tasks/ {id} - queued
- รอเครื่องว่าง
- running
- กำลังสร้าง
- succeeded
- เสร็จแล้ว: outputs[].url มีไฟล์
- failed
- ไม่สำเร็จ: ไม่เสียเงิน
ข้อผิดพลาดและวิธีแก้
401ไม่มีคีย์หรือคีย์ผิด
ส่งเฮดเดอร์ Authorization: Bearer พร้อมคีย์จากคอนโซล
402ยอดเงินไม่พอ
เติมเงินในหน้าการเรียกเก็บเงิน แล้วส่งคำขอเดิมอีกครั้ง
400มีค่าที่ระบบไม่รับ
อ่าน error.message ซึ่งบอกชื่อช่อง แล้วใช้ค่าจากตารางพารามิเตอร์
429คำขอมากเกินไป
รอสักครู่แล้วลองใหม่ และรอนานขึ้นทุกครั้งที่เจอ 429
เพิ่ม Opennan ในแอป AI ของคุณ
ติดตั้งครั้งเดียว AI ของคุณใช้ได้ทุกเครื่องมือของ Opennan: วิดีโอ รูปภาพ แชต เสียงพูด เพลง เอฟเฟกต์เสียง 3D คำบรรยาย และพากย์เสียง เลือกแอปของคุณแล้วทำตามขั้นตอน
https:/ / api.opennan.com/ v1/ mcpใช้ได้กับ Codex CLI, แอป Codex และส่วนขยาย Codex ใน IDE เพราะใช้ ~/.codex/config.toml ร่วมกัน ถ้าแอปหรือ IDE มองไม่เห็น OPENNAN_KEY ให้ใช้แบบ config.toml ที่ใส่คีย์ไว้ Codex จะถามก่อนเรียกเครื่องมือแต่ละครั้ง กดอนุมัติเพื่อไปต่อ
บันทึกคีย์เป็น OPENNAN_KEY
# macOS / Linux (zsh shown; bash: ~/.bashrc) echo 'export OPENNAN_KEY="sk-..."' >> ~/.zshrc source ~/.zshrc # Windows (PowerShell), then open a new terminal setx OPENNAN_KEY "sk-..."ติดตั้งปลั๊กอิน Opennan: ได้ทั้งเซิร์ฟเวอร์และสกิลที่สอนให้ AI เลือกโมเดล ยืนยันราคา และรอผลลัพธ์
codex plugin marketplace add Opennan/opennan-ai-plugin codex plugin add opennan@opennanหรือเพิ่มแค่เซิร์ฟเวอร์
codex mcp add opennan --url https://api.opennan.com/v1/mcp --bearer-token-env-var OPENNAN_KEYหรือเพิ่มสิ่งนี้ใน ~/.codex/config.toml
[mcp_servers.opennan] url = "https://api.opennan.com/v1/mcp" http_headers = { Authorization = "Bearer sk-..." }ตรวจว่ามี opennan อยู่ในรายการ
codex mcp listรีสตาร์ต Codex แล้วสั่งได้เลย
“ทำวิดีโอ 5 วินาทีเป็นฝนตกบนถนนแสงนีออน พร้อมเพลงประกอบและภาพโปสเตอร์”
แทน sk-... ด้วยคีย์ของคุณและเก็บเป็นความลับ ใครมีคีย์นี้ก็ใช้ยอดเงินของคุณได้ แอปแสดงรายการเครื่องมือได้ก่อนใส่คีย์ แต่การสร้างงานต้องใช้คีย์
ใช้จากเอเจนต์ AI
เพิ่มเซิร์ฟเวอร์ MCP ของ Opennan ให้เอเจนต์ แล้วเรียกเครื่องมือนี้
- เครื่องมือ
- translate_captions
- ตัวอย่างอาร์กิวเมนต์
{ "segments": [ { "start": 0.2, "end": 2.24, "text": "Hello and welcome to our coffee shop." }, { "start": 3.04, "end": 5.16, "text": "Today we have fresh chocolate cakes." }, { "start": 5.88, "end": 6.5, "text": "Want to try them?" } ], "target_language": "th", "source_language": "en" }
Caption translation: คำถามที่พบบ่อย
Caption translation ราคาเท่าไร
$0.00591 per 1,000 characters. The Run button shows the exact price for your input before you start.
เรียกจากโค้ดของฉันอย่างไร
ส่ง POST https://api.opennan.com/v1/captions/translations พร้อมคีย์ API ของคุณ ระบบตอบกลับด้วย id งาน: ตรวจ https://api.opennan.com/v1/tasks/{id} จนกว่างานจะสำเร็จหรือไม่สำเร็จ
เอเจนต์ AI ของฉันใช้ได้ไหม
ได้ เพิ่มเซิร์ฟเวอร์ MCP https://api.opennan.com/v1/mcp แล้วเรียกเครื่องมือ translate_captions หรือให้เอเจนต์อ่าน https://api.opennan.com/llms.txt
ถ้ารันไม่สำเร็จจะเป็นอย่างไร
การรันที่ไม่สำเร็จไม่คิดเงิน คุณจ่ายเฉพาะผลลัพธ์