851-labs — Background Remove API
大量処理向けの低価格・高速な背景除去。
851-labs — Background Remove を1回のAPIコールで統合できます。1つのキー、1つの統一エンドポイント、そしてApiframe上のすべてのモデルで共通の請求。
model: "851-bg-remove" 851-labs — Background Remove の特長
- 画像から画像への編集と参照画像に対応。
- 高速処理 — 1回の生成あたり平均約2秒。
- 851 Labs のアカウント不要の従量課金。成功した生成分だけお支払いいただきます。
- Apiframe のすべてのモデルで、1つのAPIキー・統一請求・冪等性・Webhookに対応。
851-labs — Background Remove で作成
Apiframeの 851-labs — Background Remove API で生成した出力例です。
概要
- エンドポイント
- POST /v2/images/background-remove
- モデルID
- 851-bg-remove
- パラメータキー
- lab851BgRemoveParams
- モダリティ
- 画像
- プロバイダー
- 851 Labs
- 平均完了時間
- ~2s
機能
クイックスタート
APIキーを添えて POST /v2/images/background-remove に1回リクエストを送るだけで 851-labs — Background Remove による生成が始まります。レスポンスには、ポーリングまたはWebhookで受け取れる jobId が返ります。
curl -X POST https://api.apiframe.ai/v2/images/background-remove \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "851-bg-remove",
"lab851BgRemoveParams": {
"image": "https://example.com/input.jpg",
"format": "png",
"threshold": 0,
"background_type": "rgba"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/background-remove",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"model": "851-bg-remove",
"lab851BgRemoveParams": {
"image": "https://example.com/input.jpg",
"format": "png",
"threshold": 0,
"background_type": "rgba"
}
},
)
print(response.json()) # { "jobId": "...", "status": "QUEUED" }const response = await fetch("https://api.apiframe.ai/v2/images/background-remove", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "851-bg-remove",
"lab851BgRemoveParams": {
"image": "https://example.com/input.jpg",
"format": "png",
"threshold": 0,
"background_type": "rgba"
}
}),
});
const { jobId } = await response.json();
console.log(jobId);レスポンスとジョブのライフサイクル
生成は非同期で行われます。送信が成功すると 202 Accepted と jobId が返ります。ステータスが COMPLETED になるまで GET /v2/jobs/{id} をポーリングする(または webhook_url を指定する)と、result フィールドに出力URLが格納されます。
1. 送信レスポンス (202)
{
"jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"status": "QUEUED"
}2. 結果をポーリング
curl https://api.apiframe.ai/v2/jobs/JOB_ID \
-H "X-API-Key: afk_your_api_key_here"import requests, time
while True:
job = requests.get(
"https://api.apiframe.ai/v2/jobs/JOB_ID",
headers={"X-API-Key": "afk_your_api_key_here"},
).json()
if job["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(job["result"])let job;
do {
await new Promise((r) => setTimeout(r, 2000));
job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
headers: { "X-API-Key": "afk_your_api_key_here" },
}).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);入力スキーマ
851-labs — Background Remove エンドポイントが受け付けるリクエストパラメータです。モデル固有のオプションは、下記のパラメータオブジェクトの中にネストされます。
| パラメータ | 型 | 必須 | デフォルト | 許可値 / 範囲 | 説明 |
|---|---|---|---|---|---|
| model | string | 必須 | "851-bg-remove" | "851-bg-remove" | このエンドポイントのモデル識別子。 |
| lab851BgRemoveParams.image | string (URL) | 任意 | — | — | Source image (URL) |
| lab851BgRemoveParams.format | string | 任意 | "png" | "png", "jpg" | Output format |
| lab851BgRemoveParams.threshold | number | 任意 | 0 | min 0, max 1, step 0.05 | Higher = more aggressive cutout. |
| lab851BgRemoveParams.background_type | string | 任意 | "rgba" | "rgba", "map", "green", "white", "blur", "overlay" | Background |
よくある質問
851-labs — Background Remove APIに関するよくある質問をまとめました。
851-labs — Background Remove の API はありますか?
はい。Apiframe は単一の REST エンドポイント(`POST /v2/images/background-remove`、`model: "851-bg-remove"`)で 851-labs — Background Remove を提供します。対応するすべてのモデルで、統一されたAPI・キー・請求をご利用いただけ、851 Labs の個別アカウントは不要です。
851-labs — Background Remove API の料金はいくらですか?
851-labs — Background Remove は Apiframe のシンプルな従量課金制で、成功した生成分のみお支払いいただきます。プランと数量割引は料金ページをご覧ください。
851-labs — Background Remove API はどのように呼び出しますか?
`X-API-Key` と、`model: "851-bg-remove"` を含む JSON ボディを添えて `/v2/images/background-remove` に POST リクエストを送ります。レスポンスで返る `jobId` を `GET /v2/jobs/{id}` でポーリングするか、Webhook で結果を受け取ります。
851-labs — Background Remove はどんなパラメータに対応していますか?
851-labs — Background Remove は、共通の `prompt`・`webhook_url` に加えて、`lab851BgRemoveParams` の下にネストされた 4 個のモデル固有パラメータを受け付けます。型やデフォルト値を含む一覧は上記の入力スキーマをご覧ください。
解決しませんでしたか?
851-labs — Background Remove API で開発を始めよう
APIキーを取得すれば数分で 851-labs — Background Remove を統合できます — 従量課金。
ご質問はありますか? Discordに参加 または 営業に問い合わせる。