実行を開始し、進行を追跡して、結果を読み取ります。このページのエンドポイントは、すべてメンバーキーと管理者キーで使えます。ライフサイクルと上限については、実行をご覧ください。
実行を開始
/v1/runsprompt か、保存済みの workflow の名前のどちらかを送信します。promptstringworkflow を指定しない場合は必須です。ワークフローと併用すると、保存済みのプロンプトを置き換えます。最大 128 KiB。inputany JSONworkflowstringmodelstringdefault_model です。filesarray{"file": "<id or name>", "path": "..."} または {"path": "...", "content": "..."} です。ファイルをご覧ください。connectionsobject{"ref": "<saved name>"} に allowed_methods または allowed_tools を任意で加えたものか、インラインの定義です。接続をご覧ください。descriptionstringinput_schemaobjectinput が満たすべき JSON Schema。一致しない場合は、パスと理由 (例: input.city: required) とともに 400 が返ります。ワークフローを使う場合は、保存されたスキーマを置き換えます。入力と出力を記述する を参照してください。output_schemaobjectfailed で終了します。ワークフローを使う場合は、保存されたスキーマを置き換えます。入力と出力を記述する を参照してください。timeout_secondsintegershellbooleantrue。webboolean | objecttrue を指定するか、制限する場合は { "allow": [domains], "search": false } を指定します。デフォルトはオフです。Web アクセスをご覧ください。zero_data_retentionbooleanfalse です。max_cost_microsintegerGET /v1/me の default_max_cost_micros です。ホスト型サービスでは、タイムアウト全体分のコンピュート料金をまかなえる額である必要があります。予算をご覧ください。callbackobject{"url": "...", "secret": "..."}。コールバックをご覧ください。Idempotency-Keystring200 で返されます。curl $EPHEMERAL_URL/v1/runs \
-H "Authorization: Bearer $EPHEMERAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7d0f3c1e-6a52-4b8e-9f21-0c4d5e6a7b89" \
-d '{
"workflow": "investigate-payment",
"input": { "payment_id": "pay_123" },
"max_cost_micros": 500000
}'レスポンスは 202 Accepted で、新しい実行オブジェクトが返ります。検証に失敗したリクエストは 400 を返し、何も作成しません。ホスト型サービスでは、402 は、利用可能なクレジットが予算をまかなえないことを意味します。
実行オブジェクト
idstringrun_4abb0f420c6623a12d2889610eb67284 など。statusstringreserving、queued、starting、running、succeeded、failed、cancelled、timed_out、interrupted のいずれか。outputstringerrorstringcreated_attimestampstarted_attimestampfinished_attimestampmax_cost_microsintegercost_microsintegerbilling_pending が false になるまでは暫定の値です。0 の場合は省略されます。billing_pendingbooleanschedule_idstringzero_data_retentionbooleantrue。surcharge_percentintegersurcharge_microsintegercost_micros のうち、ゼロデータ保持の追加料金による部分。ゼロの場合は省略されます。output_availablebooleanoutput_expires_attimestamp{
"id": "run_4abb0f420c6623a12d2889610eb67284",
"status": "succeeded",
"output": "The card issuer declined pay_123 for insufficient funds. The processor had no incidents. Ask the customer to retry or use another card.",
"created_at": "2026-10-03T09:14:05.118Z",
"started_at": "2026-10-03T09:14:05.402Z",
"finished_at": "2026-10-03T09:14:41.877Z",
"max_cost_micros": 500000,
"cost_micros": 14390,
"billing_pending": false
}実行を一覧
/v1/runslimitintegercursorstringnext_cursor。statusstringschedulestring{
"items": [
{ "id": "run_91c0…", "status": "failed", "error": "Worker failed; inspect run events. External actions may have completed.", "created_at": "2026-10-03T08:51:12.004Z", "max_cost_micros": 500000, "cost_micros": 61200, "billing_pending": false },
{ "id": "run_3fd2…", "status": "failed", "error": "Credit reservation failed", "created_at": "2026-10-02T17:20:44.390Z", "max_cost_micros": 500000, "billing_pending": false }
],
"next_cursor": "eyJvIjoib3JnXzVlMmIi…"
}limit も cursor も指定しない場合、レスポンスは、条件に一致する直近 100 件の実行を含む単純な配列です。ページネーションをご覧ください。
実行を取得
/v1/runs/{id}イベントをストリーミング
/v1/runs/{id}/eventsdone を送信して接続を閉じます。Last-Event-IDinteger: connected
id: 88412
event: status
data: {"id":88412,"type":"status","data":{"status":"running"},"created_at":"2026-10-03T09:14:05.431Z"}
id: 88415
event: worker_started
data: {"id":88415,"type":"worker_started","data":{"runtime":"pi","mode":"pi","shell":false},"created_at":"2026-10-03T09:14:07.906Z"}
id: 88419
event: tool_start
data: {"id":88419,"type":"tool_start","data":{"tool":"http_0","id":"call_1","arguments":{"method":"GET","path":"/payments/pay_123"}},"created_at":"2026-10-03T09:14:10.215Z"}
id: 88431
event: result
data: {"id":88431,"type":"result","data":{"output":"The card issuer declined pay_123 for insufficient funds."},"created_at":"2026-10-03T09:14:41.702Z"}
event: done
data: {"id":"run_4abb0f420c6623a12d2889610eb67284","status":"succeeded", …}各メッセージの data は、id、type、data、created_at を持つイベントオブジェクトです。ただし done だけは、実行オブジェクトを含みます。コロンで始まる行はコメントで、ハートビートのコメントが 15 秒ごとに送信されます。イベントの種類は、イベントの種類に一覧があります。接続を切断しても、実行はキャンセルされません。
curl -N $EPHEMERAL_URL/v1/runs/run_4abb0f420c6623a12d2889610eb67284/events \
-H "Authorization: Bearer $EPHEMERAL_API_KEY"実行をキャンセル
/v1/runs/{id}/cancelreserving、queued、starting、running のいずれかの実行をキャンセルし、実行オブジェクトを返します。すでに終了している実行は、変更されずに返されます。実行の定義を取得
/v1/runs/{id}/definition{
"request": {
"prompt": "Find out why this payment failed. Follow the playbook.",
"model": "anthropic/claude-haiku-5.5",
"files": [{ "file": "file_9c41d2a07be35f1e8a6c0d4b9e2f7a13", "path": "playbook.md" }],
"connections": {
"payments": { "ref": "payments-api", "allowed_methods": ["GET"] },
"crm": { "type": "http", "url": "https://api.example.com", "allowed_methods": ["GET"] }
},
"timeout_seconds": 120,
"shell": false,
"max_cost_micros": 500000,
"input": { "payment_id": "pay_123" }
},
"requires_credentials": ["crm"]
}request は、解決済みの定義です。ファイル名は実際に使われた ID に置き換えられ、ワークフローの保存済みフィールドが補われます。ワークフロー名とコールバックは含まれません。保存済みの接続には、参照と許可リストだけが残ります。インラインの接続では、認証情報と URL 内のシークレットが取り除かれます。
requires_credentials には、認証情報または元の URL の復元が必要なインライン接続が列挙されます。再実行するには、それらを補い、新しい max_cost_micros を選んで、リクエストを POST /v1/runs に送信します。保存済みの接続への参照はこのときに再び解決され、参照しているファイルまたは接続が削除されていると、リクエストは失敗します。
ゼロデータ保持の実行
zero_data_retention の実行は、出力を一度だけ返します。終了後の最初の GET /v1/runs/{id} は output を含めて返し、出力を削除します。以降の読み取りでは出力が省略され、output_available: false になります。実行にコールバックがある場合は、コールバックが出力を配信し、それまでは GET しても出力は残ります。配信されなかった出力は、遅くとも 1 時間後に削除されます。
イベントストリームは、実行中と終了後の数分間利用できます。GET /v1/runs/{id}/definition は 410 を返し、実行の一覧に出力は含まれません。ホスト型サービスでは cost_micros に追加料金が含まれ、予算はそれを賄える額である必要があります。