API 文件
將 E-Ink 電子書轉換服務整合到您的應用程式中
透過 AI Agent 使用 — 零設定
複製以下指令,貼到 Cursor、Claude Code、Codex 或任何 AI 程式設計助手中,即可自動安裝。
幫我安裝 E-Ink skill:執行 npx e-ink-skill,然後把環境變數 EINK_API_KEY 設定為我的 API key。支援 Cursor、Claude Code、Windsurf、Codex 等主流 AI 程式設計工具。
更多安裝方式快速開始
要使用 E-Ink API,您需要一個 API 金鑰。請在控制面板中建立,然後在請求的 Authorization 標頭中包含該金鑰。
認證方式
所有 API 請求必須在 Authorization 標頭中包含您的 API 金鑰:
Authorization: Bearer eink_your_api_key_hereBase URL
https://e-ink.me/api/v1積分系統
API 呼叫與網頁端使用相同的積分系統。
| API | 積分消耗 |
|---|---|
| 網頁轉電子書 | 3(每個 URL) |
| 檔案格式轉換 | 2 / 5(PDF OCR: 5) |
| 電子書翻譯 | 3(每個檔案) |
| 文字轉語音 | 5(每個檔案) |
| 心智圖生成 | 2 / 5(AI: 5) |
API 端點
GET
/api/v1/credits查詢積分餘額
返回目前的積分餘額。
0 credits
curl
curl https://e-ink.me/api/v1/credits \
-H "Authorization: Bearer eink_your_api_key"Response
{
"credits": 150
}POST
/api/v1/convert/webpage網頁轉電子書
將一個或多個網頁轉換為 EPUB、PDF 或 Markdown 格式。
3 credits 每個 URL
curl
curl -X POST https://e-ink.me/api/v1/convert/webpage \
-H "Authorization: Bearer eink_your_api_key" \
-H "Content-Type: application/json" \
-d '{"url": "https://e-ink.me", "format": "epub"}' \
-o article.epubPOST
/api/v1/convert檔案格式轉換
在 EPUB、PDF、Markdown、HTML、DOCX、TXT 等格式之間轉換檔案。
2 / 5 credits
curl
curl -X POST https://e-ink.me/api/v1/convert \
-H "Authorization: Bearer eink_your_api_key" \
-F "file=@book.epub" \
-F "converter=epub-to-pdf" \
-o book.pdfPOST
/api/v1/convert/translate電子書翻譯
將 EPUB 檔案翻譯為其他語言。
3 credits 每個檔案
curl
curl -X POST https://e-ink.me/api/v1/convert/translate \
-H "Authorization: Bearer eink_your_api_key" \
-F "file=@book.epub" \
-F "targetLanguage=Chinese" \
-F "sourceLanguage=auto" \
-o book-translated.epubPOST
/api/v1/convert/tts文字轉語音
將文字轉換為語音音訊(MP3 格式)。
5 credits 每個檔案
curl
curl -X POST https://e-ink.me/api/v1/convert/tts \
-H "Authorization: Bearer eink_your_api_key" \
-H "Content-Type: application/json" \
-d '{"input": "Hello, this is a test.", "voice": "en-US-JennyNeural"}' \
-o speech.mp3POST
/api/v1/convert/mindmap心智圖生成
從 EPUB 或 PDF 檔案生成心智圖。
2 / 5 credits
curl
curl -X POST https://e-ink.me/api/v1/convert/mindmap \
-H "Authorization: Bearer eink_your_api_key" \
-F "file=@book.epub" \
-F "mode=structure" \
-F "format=freemind"Response
{
"tree": { "label": "Book Title", "children": [...] },
"stats": { "nodeCount": 42, "maxDepth": 4 },
"files": {
"freemind": "<map>...</map>",
"opml": "<?xml ...?>...",
"markdown": "# Book Title\n## Chapter 1\n..."
}
}錯誤碼
| Code | Description |
|---|---|
| 400 | Bad Request — 參數無效 |
| 401 | Unauthorized — API 金鑰缺失或無效 |
| 402 | Payment Required — 積分不足 |
| 413 | Payload Too Large — 檔案超過大小限制 |
| 500 | Internal Server Error — 伺服器內部錯誤 |
AI Agent Skill
透過 Agent Skill 在 Cursor、Claude Code、Codex 等 AI 程式設計工具中直接使用 E-Ink。
安裝方式
1
直接告訴 AI
推薦複製以下指令貼到 AI 程式設計助手的對話框中,它會自動幫你完成安裝。
幫我安裝 E-Ink skill:執行 npx e-ink-skill,然後把環境變數 EINK_API_KEY 設定為我的 API key。2
手動執行 npx
npx
npx e-ink-skill3
從 GitHub 複製
git clone
# Cursor
git clone https://github.com/Selenium39/e-ink-skill.git ~/.cursor/skills/e-ink-skill
# Claude Code / Codex
git clone https://github.com/Selenium39/e-ink-skill.git ~/.claude/skills/e-ink-skill設定 API 金鑰環境變數:
export EINK_API_KEY="eink_your_api_key_here"Skill 現已在您的 AI Agent 中可用。試著問:
“把 https://e-ink.me 轉成 EPUB”
“把這本 EPUB 翻譯成中文”
“查看我的 E-Ink 積分餘額”