{
  "title": "real_cost",
  "public_path": "flex_rf.web.real_cost",
  "lookup_path": "tidy3d.web.real_cost",
  "slug": "flex_rf/web/real_cost",
  "public_url": "/rf/latest/autogenerated/flex_rf/web/real_cost/",
  "object_kind": "function",
  "introduction": "Get the billed cost for given task after it has been run.",
  "notes": "The billed cost may not be immediately available when the task status is set to `success`,\nbut should be available shortly after.",
  "examples": "To obtain the cost of a simulation, you can use the function `tidy3d.web.real_cost(task_id)`. In the example\nbelow, a job is created, and its cost is estimated. After running the simulation, the real cost can be obtained.\n\n```python\nimport time\n\n# initializes job, puts task on server (but doesn't run it)\njob = web.Job(simulation=sim, task_name=\"job\", verbose=verbose)\n\n# estimate the maximum cost\nestimated_cost = web.estimate_cost(job.task_id)\n\nprint(f'The estimated maximum cost is {estimated_cost:.3f} Flex Credits.')\n\n# Runs the simulation.\nsim_data = job.run(path=\"data/sim_data.hdf5\")\n\ntime.sleep(5)\n\n# Get the billed FlexCredit cost after a simulation run.\ncost = web.real_cost(job.task_id)\n```",
  "references": "",
  "signature": "real_cost(task_id: str, verbose: bool = True)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/web/api/webapi.py",
    "url": "",
    "lineno": 1772,
    "endlineno": 1842
  },
  "bases": [],
  "parameter_rows": [
    {
      "name": "task_id",
      "annotation": "str",
      "default": "",
      "description": "",
      "origin": "declared"
    },
    {
      "name": "verbose",
      "annotation": "bool",
      "default": "True",
      "description": "",
      "origin": "declared"
    }
  ],
  "members": [],
  "group": "flex_rf.web"
}
