---
title: "Goal Seek"
method: POST
path: "/api/goal-seek"
---

# Goal Seek

`POST /api/goal-seek`

## Request

- Base URL: `https://biotechdsp-579272663320.europe-west1.run.app`
- URL: `https://biotechdsp-579272663320.europe-west1.run.app/api/goal-seek`
- Auth: HTTP bearer

"Can this flowsheet reach X $/kg, and if not, what would have to be true?"

Topology is fixed. Stage 1's answer is apply-able operating settings; stage 2's answer
is a list of single-lever requirements (titre, resin capacity, fouling factor, ...)
that are explicitly NOT written back to the canvas.

## Request body

- GoalSeekBody: Same feed and steps the simulation posted, goal-sought against a cost target. Stage 1 searches the operating (and optionally equipment) parameters for settings that reach `target_cogs_per_kg`, stopping early when they do. If they cannot, stage 2 opens the model-role calibrations and the feed titre one at a time and reports the value of each at which the target becomes reachable - R&D requirements, not settings.
  - `annual_operating_hours` integer
  - `cooling_water_price_usd_per_m3` number
  - `electricity_price_usd_per_kWh` number
  - `facility_type` string, nullable
  - `feeds` object
  - `labor_profile` string
  - `max_evaluations` integer
  - `max_multiplier` number
  - `min_annual_product_kg` number, nullable
  - `min_purity` number
  - `min_yield` number
  - `optimize_feed_flow` boolean
  - `product_identity_requested_targets` string[]
  - `product_identity_warnings` string[]
  - `product_selling_price_source` 'default' | 'user_supplied'
  - `product_selling_price_usd_per_kg` number
  - `recycles` RecycleSpec[]
    - `fraction` number, required
    - `from_step` integer, required
    - `outlet` 'light' | 'heavy'
    - `to_step` integer, required
  - `roles` string[]
  - `seed` integer
  - `skip_steps` integer[]
  - `steam_price_usd_per_GJ` number
  - `steps` object[], required
  - `stream` object, required
  - `stream_closure_warnings` string[]
  - `target_cogs_per_kg` number, required
  - `target_products` string[], required
  - `target_provenance` object, nullable
  - `terminal_streams` TerminalStream[], nullable
    - `fraction` number, required
    - `output_index` integer, required
    - `port_id` string, required
    - `sink` 'product' | 'waste' | 'vent', required
    - `step_index` integer, required
    - `target_products` string[]
    - `terminal_id` string, required
  - `wastewater_scope` 'included' | 'excluded_osbl'

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/untangle/apis/untangle-bio-engine-api.md) · [All operations](https://skmtc.dev/untangle/apis/untangle-bio-engine-api/llms.txt) · [OpenAPI document](https://skmtc.dev/untangle/apis/untangle-bio-engine-api/revisions/161714bf261c?raw)
