STATEK API Reference
This reference covers the STATEK APIs used by the public docs and the high-level implementation surface in /src/statek/statek. It is organized by category so application code can start with agents, jobs, tools, and settings, then move into advanced runner and provider APIs when needed.
Prefer the high-level patterns in the guide pages before depending on lower-level runner, queue, provider, or temporal APIs. STATEK restricted mode limits model-written Python, but production code execution still requires permissioning, secrets discipline, process and resource limits, and operational controls in the hosting application.
Install and import
Install STATEK with a dbzero extra:
pip install "statek[dbzero]"Most reference pages show direct implementation imports because several high-level classes are not re-exported from the package root:
import statek
from statek.agents.agent import Agent
from statek.executors.job import Job, JobDef, JobStatus
from statek.executors.utils import run_job_stepstatek.init(settings=None) initializes process-level STATEK setup. In the current implementation it loads model pricing metadata when StatekSettings.statek_model_info_dir is configured.
| Item | Import path | Stability | Page |
|---|---|---|---|
| Agents and agent templates | statek.agents.* | Stable core and specialized helpers | Agents |
| Job definitions and execution state | statek.executors.job | Stable core | Jobs |
| Tool decorators and system tools | statek.system | Stable core, some advanced helpers | Tools |
| Delegated child jobs | statek.task | Stable core | Subtasks |
| Future and temporal primitives | statek.future | Advanced | Futures |
| Model provider abstraction | statek.llm_api | Advanced extension API | Providers |
| Settings and logging | statek.settings | Stable configuration API | Settings |
| Prompt definitions | statek.prompt_config | Stable prompt-file API | Prompts |
| Worker startup, loops, and queue helpers | statek.runner, statek.executors.utils | Operational, some provisional helpers | Runners |
| External job submission | statek.statek_client_api | Provisional external API | Client API |
| Examples and documents | statek.executors.example, statek.document, statek.agents.* | Stable helper APIs | Examples and Documents |
| Current execution context | statek.utils, statek.shared_context | Stable and provisional helpers | Context |
Stability notes
Core application APIs are Agent, JobDef, Job, JobStatus, @tool, @subtask, SubTaskHandler, StatekSettings, LLM_API_Settings, prompt definitions, start_statek, start_statek_async, and the documented example/document helpers. Advanced APIs are useful but closer to STATEK internals: temporal futures, queue processing, provider subclassing, shared context, and runner internals.
This reference intentionally excludes parser internals, low-level chat log item classes, dbzero plumbing, test helpers, and private helpers unless another public docs page already relies on them.