Configure OpenScience to send its requests to FlexInference. This is config only: no source change, no fork, no patch.
You will never see or handle my API key. The provider entry stores only the `{env:FLEXINFERENCE_API_KEY}` template, and I export the value myself. Do not ask me for the key, and do not read it from my environment.
1. Create a directory named `config/` and put `openscience.json` in it with this content:
{
"$schema": "https://syntheticsciences.ai/config.json",
"model": "flexinference/gpt-5.6-sol",
"provider": {
"flexinference": {
"name": "FlexInference",
"env": ["FLEXINFERENCE_API_KEY"],
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "{env:FLEXINFERENCE_API_KEY}",
"baseURL": "https://api.flexinference.com/v1"
},
"models": {
"gpt-5.6-sol": {
"name": "GPT-5.6 Sol",
"reasoning": true,
"tool_call": true
}
}
}
}
}
2. Print these lines for me to run. Do not run the export and do not ask for the value:
export FLEXINFERENCE_API_KEY=<paste your key here>
OPENSCIENCE_CONFIG_DIR=./config bun run dev
3. Add `config/package.json`, `config/bun.lock`, and `config/node_modules/` to `.gitignore`. OpenScience writes those into any directory it loads config from on first run.
Rules that matter, do not deviate:
- Use `OPENSCIENCE_CONFIG_DIR`, not `OPENSCIENCE_CONFIG`. The first names a directory and scans it for commands, agents, and plugins. The second names a single file and scans nothing.
- If I ask for a plugin, place the file at `config/plugins/<name>.js` and leave the `plugin` key out of the JSON entirely.
- Tell me that any `.openscience` or `.synsc` directory inside a repository I open is also scanned for plugins, and that those plugins run with my exported key in the environment. Recommend I export the key only in the launch shell. Every entry in that array without a `file://` prefix is treated as an npm package name and handed to `bun add`, which fails and takes plugin startup down. The directory scan is one level deep and loads every `.js` and `.ts` sitting directly in `plugins/`, so keep shared modules outside it.
- Do NOT put `start_within` in any model's `options`. FlexInference injects a key default only when the field is ABSENT, so writing it here permanently overrides my agent key's deadline with whatever you hardcoded. Only add it if I tell you I am not using an agent key.
- Keep `options.apiKey` as the literal `{env:FLEXINFERENCE_API_KEY}` template. Never inline my key.
- The top-level `model` field is what selects the provider. Without it OpenScience stays on its built-in default.
- Every key under `models` is a slug sent verbatim on the wire, so it must be one FlexInference serves.
Verify the file is valid JSON, then report what you created and the exact command to run.