Skip to main content
OpenWork drives an OpenCode backend, so the file you write is an OpenCode config file. The backend reads the provider entry out of it. OpenWork gives you nowhere to set start_within in its own UI, so the deadline rides on the key. Create one first: see agent keys.

Set this up with an agent

Open the block below and copy it into any coding agent. The prompt never asks for your API key: the agent configures everything else, then prints the one export line for you to run yourself.

Configure OpenWork

  1. Put an opencode.json in a directory of its own. Use the provider entry from OpenCode.
  2. Export the key in the shell that starts OpenWork.
  3. Launch OpenWork with the import path set.
OpenWork keeps the backend on an isolated profile, so it ignores a config file in your working directory. It copies the named directory into the profile on launch, then starts the backend with OPENCODE_CONFIG_DIR set to that copy. pnpm dev sets OPENWORK_DEV_MODE=1, which is what turns the import on. OpenWork passes the parent environment through to the backend, so FLEXINFERENCE_API_KEY reaches the provider entry.

Scope comes from the profile, not the folder

OpenWork doesn’t read config out of your working directory, so the global and per-project split that OpenCode offers doesn’t apply here. Scope comes from the profile you launch against. Keep one pair of profile paths per configuration you want to switch between. The same bundle imported into two profiles gives you two isolated setups, each with its own session history. Reuse the paths above to keep a profile. Change them to start a fresh one.

The import copies on every launch and never deletes

The copy runs on every launch, and it overwrites. Edit the bundle, restart on the same OPENWORK_ELECTRON_USERDATA and OPENWORK_DATA_DIR paths, and the backend reads the new file. It never deletes. A file you removed from the bundle stays in the profile copy. Clearing that needs fresh paths for both variables, which starts the profile over and loses its session history. Do that only when a leftover file is in the way.

Confirm the key applied

Every response comes with x-flexinference-defaults-applied. Neither the backend nor the OpenWork UI shows response headers, so read the request in the dashboard under Logs instead.

Troubleshooting

The import never ran. OPENWORK_DEV_MODE=1 is what enables it, and pnpm dev sets it. A production launch skips the import. A config edit changed nothing. The copy runs per launch but only onto the profile it was given. Restart on the same OPENWORK_ELECTRON_USERDATA and OPENWORK_DATA_DIR paths. A file you deleted is still loaded. The copy overwrites but never deletes. Start a fresh profile with new paths for both variables, accepting the loss of session history. Requests never reach us. The top-level model field in the bundle is what selects the provider. Without it the backend stays on its built-in default. 401 invalid_api_key. FLEXINFERENCE_API_KEY is unset in the shell that started OpenWork. Export it there, since the backend inherits that shell’s environment. See errors for every refusal we return, agent keys for the ones that are not specific to OpenWork, and OpenCode for the provider entry and the per-model deadline options.