POST /v1/dramas, and get back a run (run_…). Progress, confirmation, redo and cancellation go through the shared /v1/workflow_runs endpoints.
Catalog
GET /v1/workflows lists the workflows you can call. GET /v1/workflows/{author}/{slug} returns one of them. Both work without an API key; anonymous calls list public workflows only. The same catalog is on geekidea.ai/workflows.
POST /v1/workflows/{author}/{slug}/quote takes the same body as the start endpoint and runs nothing. It returns estimated_cost_usd (the amount held for the first segment), its model_cost_usd and fee_usd, total_cost_usd for all steps, and each step with next_segment showing whether it is in the first segment. Model cost is an estimate; you pay for the calls actually made.
Runs
GET /v1/workflow_runs/{id} returns the run with its steps and costs.
Step
status is one of:
A failed step is retried automatically when the error allows it;
attempt counts the tries. Retries don’t charge the feature fee again.
Stream progress
GET /v1/workflow_runs/{id}/events streams the run as Server-Sent Events. Each time the status, progress, cost or a step changes, you get a workflow.run event with the whole run object. When the run ends you get data: [DONE] and the stream closes.
- A
: pingcomment is sent every 15 seconds while nothing changes. - A connection lasts at most 30 minutes. Reconnect with the
Last-Event-IDheader set to the lastidyou received; if nothing has changed since, nothing is sent again. Changes in between are not replayed: you get the latest state. - A run in
waiting_inputkeeps the stream open until it ends or the connection times out.
Confirmation points
Some steps stop for confirmation when they finish: the step becomeswaiting_input, and so does the run. You can then read and edit what the step produced (for example a drama’s storyboard or a clone’s plan) before anything more is spent. Which steps stop is shown by confirm in the catalog and in each guide.
GET /v1/workflow_runs/{id}/quotereturns what confirming will hold:estimated_cost_usdfor the steps up to the next confirmation point (or to the end), andtotal_cost_usdfor all remaining steps.POST /v1/workflow_runs/{id}/confirmaccepts the waiting steps, holds the next segment and continues.
409 workflow_invalid_state when the run is not waiting_input, and 402 when your balance, the API key’s limit or budget_usd can’t cover the next segment.
To skip confirmations, turn on auto-confirm when you start the workflow (auto_confirm: true on dramas and video clones). The run’s auto_continue is then true: steps that would stop for confirmation succeed right away, and the whole run is held as one segment.
Budget
Setbudget_usd when you start a workflow to cap what the run may cost. Before each segment starts (start, confirm, redo), GEEKIDEA checks that the settled cost plus the segment’s estimate stays within the budget; if not, the request fails with 402 workflow_budget_exceeded and nothing starts.
A segment is held at an estimate. If the actual spending reaches the held amount, or your balance or key limit runs out, the step that needed more stops as waiting_input with error_code workflow_charge_exhausted (or workflow_budget_exceeded, insufficient_quota, api_key_limit_reached). The run pauses in waiting_input and a workflow.budget_exceeded webhook is sent. Confirming queues that step again under a new hold.
Redo a step
POST /v1/workflow_runs/{id}/steps/{stepKey}/redo resets the step and every step that depends on it, holds the cost of running them again, and starts.
- Allowed when the run is
waiting_input,succeededorfailed. A run that isrunningorcancelled, or a skipped step, returns409 workflow_invalid_state. An unknown step returns404 workflow_step_not_found. - Redo is charged like new work: model calls and feature fees of the earlier attempt are not refunded.
PUT on a drama artifact or a clone plan) also resets the steps that depend on it and puts the run back in waiting_input; confirm to continue with your edit.
Cancel
POST /v1/workflow_runs/{id}/cancel cancels the run. Unfinished steps become cancelled, and model calls in flight are cancelled too. Costs already incurred (finished calls and succeeded steps) are charged; the rest of the hold is released. Cancelling a run that has already ended returns it unchanged.
Charges
A workflow is billed per charge (wfc_…): one hold and one settlement for each segment of steps between confirmation points. Charges are opened by:
- When a charge opens, its estimated cost (model cost + feature fees of the segment) is held from your balance once. Model calls inside the segment don’t hold separately.
- When the segment ends, the charge settles at the actual model cost plus the feature fees of the steps that succeeded, never more than the hold. The rest is released.
- The feature fee prices are locked when the charge opens.
- A step’s feature fee is charged once when it succeeds. Automatic retries are not charged twice, and failed model calls are not charged.
- A redo opens a new charge and charges the steps again, feature fee included.
- Cancelling keeps already-succeeded steps and finished calls charged.
GET /v1/generations/{id} accepts a run ID or a charge ID. For a run it returns the total over all its charges; for a charge, that segment. Both include line_items: every model call (type: "model", with its id, model, step and cost) and every feature fee (type: "workflow_fee", with step, unit, quantity, unit_price and amount). usage.cost_details splits the cost into models and workflow_fee. See Billing for prices.
Idempotency
SendIdempotency-Key when you start a workflow, start the next drama episode, create a clone revision, confirm or redo. Within a project, a key is accepted once: a retry with the same key returns the existing drama, clone or run, and nothing is held twice. Use a new key for each operation.
Webhooks
Webhook endpoints can subscribe to workflow events:
The run object is the same as
GET /v1/workflow_runs/{id}.