Docs

调用文档

创建 prediction,拿结果,接进产品。

申请 API Key

申请模型调用凭证

申请一个 FounderHooks API Key,用统一接口调用模型能力并管理用量。

API 接入

统一的模型调用接口

用一组 FounderHooks API Key 调用已开放的模型能力。
同一套请求格式适配在线试跑、产品接入和异步结果查询。
保留必要的调用记录,便于排查问题和管理用量。
Predictions 生命周期

FounderHooks 接收 model 和 input 参数,创建 prediction,并返回统一的结果结构。

用 model + input payload 创建 prediction。
通过 FounderHooks prediction id 端点轮询状态。
调用凭证和用量管理统一放在 FounderHooks 工作区。
流式输出

语言和语音模型往往需要流式输出。平台体验应该把 streaming 当成一等能力,而不是藏在 SDK 里的细节。

流式返回部分输出或中间事件。
在 playground 里立即展示部分结果。
API 示例也保持同样的调用方式。
Webhooks 与异步回调

对视频、批量图像或多步骤运行来说,webhook 往往是默认集成方式。FounderHooks 会把 webhook 模式直接讲清楚,并放进示例代码里。

在创建 prediction 时附带 callback URL。
遇到临时失败时自动重试。
按 prediction 记录事件回执,方便调试。
curl
API 示例
curl -s -X POST https://www.founderhooks.com/api/v1/predictions \
  -H "Authorization: Bearer $FOUNDERHOOKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "black-forest-labs/flux-schnell",
    "input": {
      "prompt": "Generate a polished product visual for an AI platform homepage"
    },
    "wait": 10
  }'
JavaScript
API 示例
const response = await fetch("https://www.founderhooks.com/api/v1/predictions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FOUNDERHOOKS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "black-forest-labs/flux-schnell",
    input: {
      "prompt": "Generate a polished product visual for an AI platform homepage"
    },
    wait: 10,
  }),
});

const prediction = await response.json();