Felo API PlatformFelo API Platform

Felo APIs

PPT Task API

建立 PPT 生成任務、列出主題,並輪詢共享任務 endpoints。

POST/v2/ppts

認證

Bearer API key

Content type

application/json

限流說明

可能適用 endpoint 專屬限制。

非同步任務

本頁說明既有的 /v2 Felo APIs,使用 Felo 帳戶權益與 Pro 點數規則。是否扣除點數取決於 操作。若要使用平台餘額呼叫,請選擇支援的 Felo OpenAPI 端點;請求與回應格式可能不同。

已生成的簡報也可能作為相關 LiveDoc 中的 ai_ppt 資源出現。若要在你的應用程式中顯示投影片文字與中繼資料,請讀取資源內容並解碼其 slides 陣列;每張投影片的 content 可能又是另一個 JSON 字串。請參閱 LiveDoc 資源內容格式。投影片預覽連結與匯出的 PPTX 下載連結有各自不同的過期規則。

PPT Task API 提供非同步 PPT 生成能力。你可以建立任務,然後透過 task_id 輪詢任務狀態。你也可以瀏覽可用的 PPT 主題,並在建立任務時套用它們。

與 AI 代理人一起使用

若要從 Agent 建立投影片,請安裝完整的 felo-ai 套件,而不是固定子集合。其安裝程式會動態探索每個包含 SKILL.md 的套件目錄,包括 PPT Skill 與未來新增項目。請將所有探索到的 Skills 安裝到你的 Agent 原生目錄:Codex ~/.codex/skills、Claude Code ~/.claude/skills、OpenClaw ~/.agents/skills,或 Hermes Agent ~/.hermes/skills。請遵循 手動 AI Agent 設定指南 進行各平台專屬的 API 金鑰設定與驗證。

驗證

所有請求都需要在 Authorization 標頭中提供 API Key:

Authorization: Bearer YOUR_API_KEY

1. 列出 PPT 主題

使用分頁、關鍵字搜尋、語言與類型篩選來查詢可用的 PPT 主題。

端點

GET https://openapi.felo.ai/v2/ppt-themes

查詢參數

參數類型必填說明
langstring否本地化內容的語言代碼(例如 en、zh-Hans)。預設:en
typestring否依主題類型篩選(例如 default、custom)
keywordstring否搜尋關鍵字,會比對主題標題
pageinteger否頁碼,從 1 開始。預設:1
sizeinteger否每頁大小,最大 100。預設:20

範例

curl -X GET 'https://openapi.felo.ai/v2/ppt-themes?lang=en&page=1&size=10' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY'

成功回應(200)

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "total": 8,
    "page": 1,
    "size": 10,
    "items": [
      {
        "id": "43122897-0d3c-4c9e-ae19-20527ad36c04",
        "title": "Inspiration Themes",
        "subtitle": "AI-tailored visual solutions",
        "description": "Style and layout, both crafted by AI from your content in real time"
      }
    ]
  }
}

主題回應欄位

欄位類型說明
totalinteger符合篩選條件的主題總數
pageinteger目前頁碼
sizeinteger每頁大小
itemsarray主題物件清單
items[].idstring主題 ID,建立 PPT 時將此值用作 ai_theme_id
items[].titlestring主題標題(已本地化)
items[].subtitlestring主題副標題(已本地化)
items[].descriptionstring主題描述(已本地化)

2. 建立 PPT 任務

端點

POST https://openapi.felo.ai/v2/ppts

請求標頭

標頭必填說明
Authorization是你的 API Key,格式為 Bearer YOUR_API_KEY
Content-Type是application/json 或 multipart/form-data

請求主體

參數類型必填說明
querystring是PPT 生成請求提示詞
livedoc_short_idstring否要與 PPT 工作階段關聯的既有 LiveDoc short ID。若省略,會自動建立新的 LiveDoc。
resource_idsarray of strings否要作為 PPT 生成上下文的 LiveDoc 資源 ID 清單
ppt_configobject否PPT 設定選項
ppt_config.ai_theme_idstring否來自 列出 PPT 主題 端點的主題 ID

範例

curl -X POST 'https://openapi.felo.ai/v2/ppts' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "Felo, 2 pages",
    "ppt_config": {
      "ai_theme_id": "02968979-a69f-42c4-b136-de02c40ab2d7"
    }
  }'

從上傳檔案建立

使用 multipart/form-data 上傳一個檔案,並在單一請求中建立 PPT 任務。平台會先將檔案上傳為 LiveDoc 資源,然後再將其資源 ID 傳遞給 PPT 任務。

部分類型必填說明
querystring是PPT 生成請求提示詞
filefile是作為 PPT 上下文的來源檔案
stream_protocolstring否串流協定;預設為 message_center_v1
livedoc_short_idstring否接收檔案的既有 LiveDoc。若省略,會建立新的 LiveDoc。
ppt_configJSON否與 JSON 請求主體相同結構的 PPT 設定。請將此部分以 application/json 傳送。
curl -X POST 'https://openapi.felo.ai/v2/ppts' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'query=Create a 10-page presentation based on this report' \
  -F 'ppt_config={"ai_theme_id":"02968979-a69f-42c4-b136-de02c40ab2d7"};type=application/json' \
  -F '[email protected]'

回應會使用與 JSON 請求相同的 schema。回傳的 livedoc_short_id 會識別包含上傳資源的 LiveDoc。

成功回應(200)

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "livedoc_short_id": "PvyKouzJirXjFdst4uKRK3",
    "ppt_business_id": "BfLPuQKmChk9SPmyQawxgr",
    "task_id": "019cad6d-e874-55ef-d577-686344b5a7e9"
  }
}

3. 查詢任務狀態

端點

GET https://openapi.felo.ai/v2/tasks/{task_id}/status

範例

curl -X GET 'https://openapi.felo.ai/v2/tasks/019cad6d-e874-55ef-d577-686344b5a7e9/status' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY'

成功回應(200)

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "status": "RUNNING"
  }
}

4. 查詢任務歷史資訊

端點

GET https://openapi.felo.ai/v2/tasks/{task_id}/historical

範例

curl -X GET 'https://openapi.felo.ai/v2/tasks/019cb17e-9e23-3d40-4447-48a651249460/historical' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY'

RUNNING 回應

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "task_id": "019cb17e-9e23-3d40-4447-48a651249460",
    "task_status": "RUNNING",
    "ppt_biz_id": "oM8A9iJHg8dT4ZKgHThQTx",
    "ppt_url": "https://felo.ai/slides/oM8A9iJHg8dT4ZKgHThQTx"
  }
}

COMPLETED 回應

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "task_id": "019cb17e-9e23-3d40-4447-48a651249460",
    "task_status": "COMPLETED",
    "ppt_biz_id": "oM8A9iJHg8dT4ZKgHThQTx",
    "ppt_url": "https://felo.ai/slides/oM8A9iJHg8dT4ZKgHThQTx",
    "live_doc_short_id": "oM8A9iJHg8dT4ZKgHThQTx",
    "live_doc_url": "https://felo.ai/livedoc/oM8A9iJHg8dT4ZKgHThQTx"
  }
}

COMPLETED 回應(AI_PAGE)

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "task_id": "019d7a4d-6ab5-a96d-0f98-43ca434ab621",
    "task_status": "COMPLETED",
    "ppt_biz_id": "9qiLTmT77fA3aVurrMHvRJ",
    "ppt_url": "https://felo.ai/slides/9qiLTmT77fA3aVurrMHvRJ",
    "ai_page_html": "https://api-ext-index-file.felo.ai/html/address?message_id=9qiLTmT77fA3aVurrMHvRJ"
  }
}

FAILED / PENDING / EXPIRED / CANCELED 回應

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "task_id": "019cb17e-9e23-3d40-4447-48a651249460",
    "task_status": "FAILED",
    "ppt_biz_id": "oM8A9iJHg8dT4ZKgHThQTx",
    "ppt_url": "https://felo.ai/slides/oM8A9iJHg8dT4ZKgHThQTx",
    "error_message": "PPT generation failed",
    "live_doc_short_id": "oM8A9iJHg8dT4ZKgHThQTx",
    "live_doc_url": "https://felo.ai/livedoc/oM8A9iJHg8dT4ZKgHThQTx"
  }
}

歷史回應欄位

欄位類型說明
task_idstring任務 ID
task_statusstring目前任務狀態
ppt_biz_idstringPPT business ID(由後端 thread_short_id 對應而來)
ppt_urlstringPPT URL,格式:https://felo.ai/slides/{ppt_biz_id}
error_messagestring當狀態為 FAILED / PENDING / EXPIRED / CANCELED 時存在;若下游未提供錯誤詳細資訊,則為空字串 ""
ai_page_htmlstring當任務以 AI_PAGE 模式執行,且下游歷史資訊回傳 HTML 結果 URL 時存在
live_doc_short_idstringLiveDoc short ID。對於 COMPLETED,它來自下游 live_doc_short_id;對於終端失敗狀態,若可用則會回傳
live_doc_urlstring與 live_doc_short_id 對應的 LiveDoc URL

匯出 PPTX

當 PPT 生成任務達到 COMPLETED 後,請使用建立回應中的 ppt_business_id(或歷史回應中的 ppt_biz_id)提交非同步匯出:

curl -X POST 'https://openapi.felo.ai/v2/ppts/YOUR_PPT_BUSINESS_ID/export' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'

每 2–5 秒使用相同的 Bearer API Key 輪詢 GET https://openapi.felo.ai/v2/ppts/{ppt_business_id}/export。API Key 擁有者必須擁有該 PPT。兩個端點都會回傳 data.status:NOT_STARTED、PROCESSING、COMPLETED 或 FAILED。只有 COMPLETED 會包含 download_url 與 expires_at。

簽署後的下載 URL 會在發出後 30 分鐘過期。再次呼叫 GET 端點可取得新的 URL;這不會重新生成 PPTX。POST 使用 application/json 並接受 {}。當匯出正在處理時重複送出 POST 不會啟動另一個作業;在完成後再次呼叫則會重新生成 PPTX,並為新的匯出請求 10 個 Felo 點數。點數不足會回傳 HTTP 402。端點層級可能有速率限制;若遇到 HTTP 429,請稍後重試。失敗的匯出可以重新提交。

{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "status": "COMPLETED",
    "download_url": "https://example.com/presentation.pptx?signature=...",
    "expires_at": "2026-09-29T10:30:00Z"
  }
}

輪詢建議

請使用建立回應中的 task_id,每 2-5 秒輪詢一次狀態,直到狀態變為終端狀態。

常見狀態範例:

  • RUNNING:任務仍在處理中
  • COMPLETED:任務已成功完成
  • FAILED / PENDING / EXPIRED / CANCELED:任務已達終端狀態並附帶 error_message;若可用,也會回傳 live_doc_url

隨著後端演進,可能會出現未知的狀態值;除非另有文件說明,請將它們視為非終端狀態。

錯誤代碼

代碼HTTP 狀態說明
INVALID_API_KEY401API Key 無效或已撤銷
PPT_TASK_CREATE_FAILED502建立任務的下游呼叫失敗
PPT_TASK_QUERY_FAILED502查詢任務狀態的下游呼叫失敗

需要協助嗎?