Options API
Resolves a workflow's runtime options — most notably the credit cost — without submitting the task. The executor's options() method is only invoked for workflows registered with enablePreflight: true; otherwise the response falls back to the workflow's statically configured monetization (if any) and is {} when none is configured.
See also: Runtime Options.
Path
POST /workflows/<TASK_NAME>/options
Request Body
{
"params" : {} // your task command
}
Response Body
{
"status" : "success",
"response" : {
"monetization" : { "toolId" : "example_tool" }, // resolved tool id
"usageAmount" : 3, // resolved usage amount
"credits" : 30 // total credits to charge for the task
}
}
cURL Example
curl --location '{BASE_URL}/workflows/<TASK_NAME>/options' \
--header 'Authorization: Bearer <USER_TOKEN>' \
--header 'x-app-authorization: Bearer <CLIENT_TOKEN>' \
--header 'platform: website' \
--header 'x-touchpoint: <touchpoint>' \
--data '{
"params": {}
}'