> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexinference.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenWorker

> Point OpenWorker at FlexInference through its OpenAI provider.

OpenWorker points its OpenAI provider at any OpenAI-compliant server. Keys sit in the app's local secret store, not in a file.

OpenWorker gives you nowhere to set `start_within` per request, so the deadline goes on the key. Create one first (see [agent keys](/agent-keys)).

<Note>
  OpenWorker is in open beta, so these fields move. Check them against your
  build.
</Note>

The endpoint and key go through the app's UI, not a file, so this page has no agent setup prompt. Only the model line sits in config.

## Configure OpenWorker

1. Open OpenWorker and go to provider settings. Pick the **OpenAI** provider.

2. Paste your agent key into **OpenAI API key**.

3. Set **Custom endpoint (optional)** to the router, including the `/v1` suffix.

   ```text theme={null}
   https://api.flexinference.com/v1
   ```

4. Set the default model in `~/.config/coworker/config.toml`.

   ```toml theme={null}
   model = "gpt-5.6-sol"
   ```

A per-workspace file at `<your-project>/.coworker/config.toml` overrides the global one. Every key in it is optional, and unset keys fall back to built-in defaults.

OpenWorker also reads `OPENAI_API_KEY` from the environment. Export your agent key there to keep it out of the secret store.

```bash theme={null}
export OPENAI_API_KEY=flex_live_...
```

## Confirm the key applied

Every response comes with `x-flexinference-defaults-applied`. OpenWorker doesn't show response headers, so read the request in the dashboard under **Logs** instead.

## Troubleshooting

**OpenWorker didn't detect the provider from the key.** It checks for `sk-` and `AIza` prefixes to guess one, and a `flex_live_` key matches neither. Pick **OpenAI** yourself.

**Requests still go to OpenAI.** **Custom endpoint (optional)** is blank, so the provider falls back to `api.openai.com`. Set it to the router URL, including `/v1`.

**[`400 unsupported_parameter`](/errors#unsupported_parameter).** OpenWorker sent a Chat Completions parameter we don't translate, and on a non-OpenAI model we refuse any one of them. Use a `gpt-*` slug.

**[`400 key_default_not_applicable`](/errors#key_default_not_applicable).** Your key holds a duration and one of those parameters came beside it. Edit the key to a tier.

**The model picker and `config.toml` disagree.** A per-workspace `.coworker/config.toml` overrides the global file. Check which one your project directory has.

See [errors](/errors) for every refusal we return, and [agent keys](/agent-keys#troubleshooting-faq) for the ones that are not specific to OpenWorker.
