APIMaster.ai

Seedanceの見積りと請求レシート

認証済みで永続的な請求レシートを使って、Seedanceの生成コストを見積もりと最終控除を検証します。

Seedanceの見積りと請求レシート

seedance-2.0、seedance-2.5、seedance-2.0-fast、seedance-2.0-miniのすべての生成チャネルに適用されます。ベースURL: https://apimaster.ai/v1 (https://apimaster.ai/v1)。すべてのリクエストは Authorization: Bearer YOUR_API_KEY で認証します。

見積りを取得する

POST https://apimaster.ai/v1/videos/quote は、標準の動画生成リクエストと同じJSONパラメータを受け付けます。model、prompt、duration、resolution、video_urls およびその他サポートされている生成設定が含まれます。下書き生成、下書きのアップグレード、リミックス の見積りは現在サポートされていません。

curl "https://apimaster.ai/v1/videos/quote" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"seedance-2.0","prompt":"A paper boat on a pond","duration":4,"resolution":"480p","generate_audio":false}'

レスポンスには object: "video.quote"、quote_id、expires_at(Unix秒)、binding: false、funds_reserved: false、および下記の billing オブジェクトが含まれます。見積りの有効期間は5分(参考用)です。資金を控除したり、タスクを作成したり、プロバイダーの生成を開始したりはしません。したがって billing.reserved_amount は "0.000000" になります。見積IDは情報提供用であり、承認トークンでも価格ロックトークンでもありません。生成時に送信する必要はありません。

価格は実際の送信時に再計算され、そのタスクに対して凍結されます。見積は最大請求額の保証ではありません。完了したタスクのコストは見積より高く也可能で、安くもあり得ます。自動期間のリクエストは30秒の出力を見積もり、requested_output_seconds は -1 になります。

生成は引き続きプロバイダーによる検証の対象です。Seedance 2.5の動画延長リクエストでは、aspect_ratio: "adaptive" を明示的に設定してください。プロバイダーによる拒否は、通常の返金ライフサイクル 통해処理されます。

タスクリシートを取得する

curl "https://apimaster.ai/v1/videos/task_xxx/billing" \
  -H "Authorization: Bearer YOUR_API_KEY"

GET /v1/videos/{task_id}/billing は object: "video.billing_receipt"、billing、customer_billing を返します。タスクを所有するアカウントの API キーが必要です。元のキーで GET /v1/video-submissions/by-key を呼ぶ場合は、data.customer_billing に利用者の課金情報が含まれます。final: true の場合、net_amount は確定した差引請求額で、米ドルの十進文字列です。過去のタスクでも、返金が確認済みなら、プロバイダー側の請求が未確認の状態で利用者の確定額がゼロと表示されることがあります。他のアカウントのタスクや、請求明細と返金記録の両方が見つからないタスクを ID で照会すると HTTP 404 が返ります。再送の可否は既存の再試行用フィールドで判断してください。

同じ billing オブジェクトは両方のタスク照会レスポンスに含まれます。

  • GET /v1/videos/{task_id}: トップレベルの billing。
  • GET /v1/video/generations/{task_id}: data.billing。

settlement_status は pending、settled、または refunded です。見積レスポンスでは estimate を使用します。タスクの完了と財務上の精算は別物です。レシートが settled または refunded のときにのみ、金額を最終的なものとして扱ってください。レシートの繰り返しリクエストでは、生成、精算、返金は実行されません。確定済みのレシートは、返金後も同じレシートIDと内容を保持します。

完全なリクエストとレスポンスの例

両方の例は、480Pのリクエスト出力4秒、4.042秒測定の参照1件、チャネル倍率1、アカウント倍率1.05の Seedance 2.0 を使用しています。完了時間と金額はライブテストからの値です。見積は、入力が一致するように組み立てた説明用の例です。IDとメディアURLはプレースホルダーです。実際のレートはAPIレスポンスから取得してください。

1. 見積りを取得する

POST https://apimaster.ai/v1/videos/quote、リクエストJSON:

{
  "model": "seedance-2.0",
  "prompt": "A paper boat moves gently on a pond.",
  "duration": 4,
  "resolution": "480p",
  "video_urls": [
    "https://example.com/reference.mp4"
  ]
}
フィールド 型 意味
model string モデルID。ここでは seedance-2.0。
prompt string 生成プロンプト。
duration integer リクエストした出力秒数。参照動画の長さではありません。
resolution string 出力解像度。ここでは 480p。
video_urls array 参照動画のURL。プレースホルダーをアクセス可能なメディアに置き換えてください。サーバーが各ファイルを測定します。

見積レスポンス:

{
  "object": "video.quote",
  "quote_id": "quote_example",
  "expires_at": 1790949324,
  "binding": false,
  "funds_reserved": false,
  "billing": {
    "schema_version": "1",
    "settlement_status": "estimate",
    "model": "seedance-2.0",
    "resolution": "480P",
    "tariff_variant": "480P-input",
    "tariff_revision": "sd-v1-b79a35d3a29af9af",
    "currency": "USD",
    "unit": "second",
    "base_unit_rate": "0.04319",
    "channel_multiplier": 1,
    "account_multiplier": 1.05,
    "effective_unit_rate": "0.0453495",
    "requested_output_seconds": 4,
    "estimated_output_seconds": 4,
    "estimated_billable_seconds": 9,
    "input_videos": [
      {
        "index": 0,
        "media_id": "media_example_hash",
        "measured_seconds": 4.042,
        "billable_seconds": 5,
        "duration_source": "apimaster_probe"
      }
    ],
    "billable_input_video_seconds": 5,
    "output": null,
    "billable_seconds": null,
    "rounding": {
      "amount_formula": "round(total_billable_seconds * effective_unit_rate / account_unit_usd) * account_unit_usd",
      "effective_unit_rate": "nearest_decimal_12_places_half_up",
      "input_video": "ceil_each_file_then_sum",
      "money": "nearest_account_unit_half_up",
      "output_video": "nearest_integer_half_up"
    },
    "estimated_amount": "0.408146",
    "reserved_amount": "0.000000",
    "additional_debit_amount": "0.000000",
    "final_debit_amount": null,
    "refunded_amount": "0.000000",
    "net_amount": null,
    "initial_quota_units": 0,
    "final_quota_units": null,
    "account_unit_usd": "0.000002",
    "media_charges": {
      "audio": "0.000000",
      "image": "0.000000",
      "input_video_unrounded": "0.2267475",
      "other_reference": "0.000000",
      "output_video_unrounded": "0.181398"
    },
    "final_debit_may_exceed_estimate": true,
    "created_at": 1790949024,
    "settled_at": null
  }
}

4.042秒の入力は5秒に切り上げられます。見積出力4秒で、見積は合計9秒を対象とし、0.408146 USD の費用となります。見積では資金を控除しないため、最終金額は null のままです。

2. 生成を送信して完了を照会する

POST https://apimaster.ai/v1/videos/generations への送信後、初期レスポンスにタスクIDが含まれます。

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_example"
    }
  ]
}

次に、同じアカウントのAPIキーを使用して GET https://apimaster.ai/v1/videos/task_example を照会します。生成と精算が完了すると:

{
  "actual_time": 189,
  "billing": {
    "schema_version": "1",
    "receipt_id": "bill_task_example",
    "task_id": "task_example",
    "settlement_status": "settled",
    "model": "seedance-2.0",
    "resolution": "480P",
    "tariff_variant": "480P-input",
    "tariff_revision": "sd-v1-b79a35d3a29af9af",
    "currency": "USD",
    "unit": "second",
    "base_unit_rate": "0.04319",
    "channel_multiplier": 1,
    "account_multiplier": 1.05,
    "effective_unit_rate": "0.0453495",
    "requested_output_seconds": 4,
    "estimated_output_seconds": 4,
    "estimated_billable_seconds": 9,
    "input_videos": [
      {
        "index": 0,
        "media_id": "media_example_hash",
        "measured_seconds": 4.042,
        "billable_seconds": 5,
        "duration_source": "apimaster_probe"
      }
    ],
    "billable_input_video_seconds": 5,
    "output": {
      "actual_seconds": 4,
      "billable_seconds": 4,
      "duration_source": "provider_reported"
    },
    "billable_seconds": 9,
    "rounding": {
      "amount_formula": "round(total_billable_seconds * effective_unit_rate / account_unit_usd) * account_unit_usd",
      "effective_unit_rate": "nearest_decimal_12_places_half_up",
      "input_video": "ceil_each_file_then_sum",
      "money": "nearest_account_unit_half_up",
      "output_video": "nearest_integer_half_up"
    },
    "estimated_amount": "0.408146",
    "reserved_amount": "0.408146",
    "additional_debit_amount": "0.000000",
    "final_debit_amount": "0.408146",
    "refunded_amount": "0.000000",
    "net_amount": "0.408146",
    "initial_quota_units": 204073,
    "final_quota_units": 204073,
    "account_unit_usd": "0.000002",
    "media_charges": {
      "audio": "0.000000",
      "image": "0.000000",
      "input_video_unrounded": "0.2267475",
      "other_reference": "0.000000",
      "output_video_unrounded": "0.181398"
    },
    "final_debit_may_exceed_estimate": true,
    "created_at": 1790949024,
    "settled_at": 1790949213
  },
  "completed_at": 1790949213,
  "created_at": 1790949024,
  "id": "task_example",
  "metadata": {
    "url": "https://apimaster.ai/v1/videos/task_example/content"
  },
  "model": "seedance-2.0",
  "object": "video",
  "progress": 100,
  "status": "completed",
  "task_id": "task_example",
  "usage": {
    "completion_tokens": 80770
  }
}

ここでは初期控除额が最終コストと等しく、追加の控除や返金はありません。billing.output.actual_seconds は出力時間、actual_time は処理時間です。usage.completion_tokens は課金額を決定しません。任意のフィールドはチャネルによって異なる場合があります。

GET https://apimaster.ai/v1/videos/task_example/billing は { "object": "video.billing_receipt", "billing": ... } を同じ課金オブジェクトとともに返します。互換用の照会 GET https://apimaster.ai/v1/video/generations/task_example では data.billing の下に配置されます。

外側レスポンスのフィールド

フィールド 型 意味
object string レスポンスの種類: video.quote、video、または video.billing_receipt。
quote_id string 情報提供用の見積識別子。価格ロックでも生成の承認でもありません。
expires_at integer Unix秒での参考用の見積失効時刻。通常は作成時刻に300秒を加えた値。
binding boolean 現在は false。見積は最終金額を保証しません。
funds_reserved boolean 現在は false。見積では资金的控除も確保も行いません。
billing object 課金詳細。以下で個別に説明します。
code integer 送信レスポンスコード。200 は送信済みであって、完了を意味しません。
data array 送信したタスクのリスト。互換用の照会では data にオブジェクトを使用します。
data[].status string 送信ステータス。この例では submitted。
data[].task_id string 以後の照会で使用する公開タスク識別子。
id string 完了照会における公開タスクID。
task_id string タスク識別子。この例では id と等しい値。
model string 公開されている生成モデル名。
status string タスクステータス。completed は生成終了を意味します。最終精算については billing.settlement_status を確認してください。
progress number 進捗率。この例では完了時に 100。
actual_time number タスクの処理秒数。出力動画の長さではありません。
created_at integer Unix秒でのタスク作成タイムスタンプ。
completed_at integer Unix秒でのタスク完了タイムスタンプ。
metadata object 生成結果のメタデータ。
metadata.url string 動画コンテンツのダウンロードURL。
usage object プロバイダーの使用量情報。チャネルによっては存在しない場合があります。
usage.completion_tokens integer プロバイダーのトークン数。的这4モデルの秒単位課金には使用されません。

課金スキーマ

すべての金額と単価は10進数の文字列です。時間は秒単位です。Nullableなフィールドは利用可能になるまで JSON の null です。

フィールド 型 意味
schema_version string 課金スキーマのバージョン。この例では "1"。
receipt_id string 安定したレシート識別子。見積には含まれません。
task_id string レシートに関連付けられた公開タスクID。見積には含まれません。
settlement_status string estimate、pending、settled、refunded
model string 適用された公開モデルID。
resolution string 課金のために正規化された解像度。
tariff_variant string 料金ティア。-input は動画参照を示し、このレートは入力と出力の両方に適用されます。
tariff_revision string モデル、料金ティア、設定された基本レート、課金ルールバージョンのフィンガープリント
currency string 通貨。現在 USD。
unit string レートの単位。second は1秒あたりを意味します。
base_unit_rate decimal string このモデルとティアに設定された1秒あたりの基本価格。
channel_multiplier number 適用されたチャネル価格倍率の集計値。
account_multiplier number 適用されたアカウント/グループ倍率。この例では 1.05。
effective_unit_rate decimal string 適用された1秒あたりのレート。送信時に凍結され、小数点以下12桁に丸められます。
requested_output_seconds integer リクエストした出力時間。自動期間の場合は -1
estimated_output_seconds integer 見積出力秒数。自動期間は30秒として見積もられます。
estimated_billable_seconds integer 参照動画と見積出力を含む、初期見積の合計課金対象秒数。
input_videos array リクエスト順の参照ごとのサーバー測定値
input_videos[].index integer リクエスト内の参照動画の位置。0から始まります。
input_videos[].media_id string アカウントスコープのメディアハッシュまたは所有アセットID。参照動画のURLはエコーされません。
input_videos[].measured_seconds number or null 丸め前のサーバー測定時間。古いキャッシュ済みアセットでは null の場合があります。
input_videos[].billable_seconds integer この参照の丸め後の課金対象時間
input_videos[].duration_source string apimaster_probe または apimaster_asset_cache
billable_input_video_seconds integer 参照ごとの課金対象秒数の合計
output object or null 最終的な出力時間情報。精算成功後に利用可能です
output.actual_seconds number or null 実際に報告・計測された出力時間。取得できない場合は null
output.billable_seconds integer 精算で実際に使用された出力秒数
output.duration_source string provider_reported、apimaster_probe、provider_billable_seconds、requested_duration_fallback、または reservation_fallback
billable_seconds integer or null 入力と出力を合算した最終的な課金対象秒数
rounding object 入力・出力・金額の丸めルールと金額の計算式
estimated_amount decimal string 初期見積コスト。最終金額でも最大請求額の保証でもありません。
reserved_amount decimal string 送信時に行われた初期アカウント控除。見積ではゼロ。銀行承認の保留ではありません。
additional_debit_amount decimal string 最終コストが初期控除を超えた場合の追加控除。
final_debit_amount decimal string or null 調整後の最終純タスクコスト。全額返金後はゼロ
net_amount decimal string or null 調整後の最終純タスクコスト。全額返金後はゼロ
refunded_amount decimal string 初期控除から返された金額。全額返金では初期控除額と等しくなります。
initial_quota_units integer 当初控除された正確なアカウント単位。見積ではゼロ。
final_quota_units integer or null 最終純コストの正確なアカウント単位数。保留中は null、全額返金後はゼロ。
account_unit_usd decimal string アカウント単位あたり "0.000002"
media_charges object 現在の料金では image、audio、other_reference はゼロです。input_video_unrounded と output_video_unrounded は、最終的な金額丸め前の動画成分を分離します
final_debit_may_exceed_estimate boolean true。見積は支出の硬い上限ではありません
created_at integer Unix秒での課金詳細の作成タイムスタンプ。
settled_at integer or null Unix秒での最終精算または返金のタイムスタンプ。確定までは null。
フィールド 型 意味
rounding.input_video string ceil_each_file_then_sum: 各入力ファイルを切り上げてから合計します。
rounding.output_video string nearest_integer_half_up: 最も近い出力秒数。0.5秒は切り上げます。
rounding.effective_unit_rate string nearest_decimal_12_places_half_up: 実効レートを小数点以下12桁に丸めます。
rounding.money string nearest_account_unit_half_up: 合計金額をアカウント単位に丸めます。
rounding.amount_formula string 最終的な合計金額の計算式。入力金額と出力金額は個別には丸められません。
media_charges.input_video_unrounded decimal string 金額丸め前の入力動画成分。
media_charges.output_video_unrounded decimal string 金額丸め前の出力動画成分。
media_charges.image decimal string 独立した画像の追加課金。現在ゼロ。
media_charges.audio decimal string 独立した音声の追加課金。現在ゼロ。
media_charges.other_reference decimal string その他の参照の追加課金。現在ゼロ。

最終コストを再計算する

参照動画がある場合、動画入力ティアは出力と参照動画の両方の秒数に適用されます。現在のSeedanceの料金では、画像と音声に独立した追加課金はありません。トークン数とプロバイダーのコストは課金の入力にはなりません。

  1. 各入力動画の測定時間を個別に切り上げてから合計します: input_seconds = sum(ceil(each_video_duration))。
  2. 出力時間を最も近い整数秒に丸め、0.5秒以上の端数は切り上げます。
  3. 入力と出力の課金対象秒数を加算します。
  4. effective_unit_rate を掛け、account_unit_usd で割ってから、合計を一度だけ最も近い整数アカウント単位に丸め、0.5単位以上の端数は切り上げます。
final_quota_units = round_half_up(billable_seconds × effective_unit_rate / 0.000002)
net_amount = final_quota_units × 0.000002
net_amount = reserved_amount + additional_debit_amount - refunded_amount

10進数演算を使用してください。入力と出力の金額成分を個別に丸めてはいけません。例えば、基本レート 0.07031、チャネル倍率 1、アカウント倍率 1.05 の、480P・参照動画なし・4秒の Seedance 2.0 タスクでは、実効レートは 0.0738255、純コストは 0.295302 USD(147651 アカウント単位)となります。

APIMaster は、input_seconds や reference_seconds などのクライアントフィールドを信頼するのではなく、参照動画の時間を測定します。リクエストした duration/seconds は出力時間を制御します。出力については、精算はプロバイダー報告の時間を優先し、必要に応じて出力を計測します。測定が取得できない場合は、プロバイダーの課金対象秒数やリクエスト済み/確保済みの時間へフォールバックする場合があります。レシートにはその情報源が明示されます。フォールバック値が独立に計測された実際の時間として記載されることはありません。既存のキャッシュ済みアセットや、旧バージョンから継承した下書きでは、ファイルごとの完全な測定詳細が欠落していることがあります。

動画レスポンスの actual_time はタスクの処理時間であり、出力動画の長さではありません。存在する場合の usage.completion_tokens は情報提供用です。

失敗と返金

プロバイダーのタスク失敗と、設定された24時間の未完了タスクタイムアウトは automatо的な全額返金alinます。返金が成功すると、それらのレシートは取得可能なままであり、純金額ゼロで refunded と表示されます。一時的なポーリング/ネットワークエラーでは、タスクは直ちに返金もキャンセルもされず、処理は再試行されます。

未課“金 footprintsれと確認された送信失敗は返金されます。送信結果が曖昧な場合は、自動照合のために保留されます(最初の非同期照合は約20分後。24時間後も不明な結果は照合中に返金されます)。送信が公開タスクを作成しなかった場合、その試行にタスク関連のレシートはありません。見積は予約ではないため、解放处理的必要はありません。

Seedanceの公開キャンセル用エンドポイントはありません。切断やポーリングの停止によってタスクはキャンセルされません。タスク状態の確認により、繰り返しのポーリングで同じ完了精算/返金が再度適用されることを防いでおり、レシート用エンドポイント自体は読み取り専用です。これらはすべてのインフラ障害に対する無条件の exactly-once 保証ではありません。保留中の財務操作を確定済みとして扱ってはいけません。

Seedance の冪等送信と障害復旧