跳至主要內容
開發者資源
開發者資源

Prompts

搜尋已發佈的 Prompt 範例,並讀取每條 Prompt 的範例素材和參考圖。

Prompts API 傳回已發佈的 Prompt 範例,以及可以執行它們的端點。介面公開,不需要 API 金鑰。

列出 Prompt

SHELL
curl "https://runapi.ai/api/v1/prompts?modality=video&q=sunset&limit=20"

可用 modality、category、tags(以逗號連接多個)、q 和 model 篩選,翻頁使用 page 和 limit(最多 100)。回應包含 prompts 和 pagination(page、per_page、total、pages)。

取得單條 Prompt

SHELL
curl "https://runapi.ai/api/v1/prompts/PROMPT_ID"

Prompt 欄位

欄位 說明 id Prompt ID。 title, prompt, negative_prompt 標題、Prompt 文字和可選的反向提示詞。 language, modality, input_kind, category, tags Prompt 元數據。 preview_url 封面圖網址;沒有範例圖時為 null。 media 全部範例素材和參考圖,按來源順序排列,見下文。 source_url, published_at 原始來源頁和發佈時間。 eligible_endpoints 可以執行該 Prompt 的端點。

素材

media 的每一項對應 Prompt 附帶的一個檔案:

欄位 說明 role example_output 或 preview 表示範例結果;reference_input 表示需要用戶自行提供的參考圖。可能為 null。 modality image、video 或 audio,小寫。可能為 null。 media_type MIME 類型,例如 video/mp4。可能為 null。 url 檔案網址。被用作封面的那一項與 preview_url 網址相同。 alt_text 文字描述,或 null。
JSON
"media": [
  {"role": "example_output", "modality": "video", "media_type": "video/mp4", "url": "https://example.test/clip.mp4", "alt_text": null},
  {"role": "reference_input", "modality": "image", "media_type": "image/png", "url": "https://example.test/face.png", "alt_text": "Face"}
]

含 reference_input 的 Prompt,只有提供你自己的參考圖,結果才會接近範例。只有影片的 Prompt 為 preview_url: null,影片從 media 讀取。