Configuration
ThinkThen sends each question and its text to a model service, which answers it and bills your account. You choose the service, the model and the key with options on each command or with THINKTHEN_ environment variables.
| What you have | What to set |
|---|---|
| A TypeSafe account, or no account yet | THINKTHEN_API_KEY. This is the default. |
| An OpenAI account | OPENAI_API_KEY and THINKTHEN_BACKEND=openai |
| A gateway or a model server of your own | THINKTHEN_URL for System One or OPENAI_BASE_URL for OpenAI, plus the model and key it expects |
An option on the command line wins over its variable. --backend openai on one command, for example, uses OpenAI for that command only.
Jev on System One, the default
Section titled “Jev on System One, the default”ThinkThen asks Jev, model jev-1.13.0, through TypeSafe's System One service at https://api.typesafe.ai/v1. You need a TypeSafe account, and each call counts against it.
- Sign in to the TypeSafe console.
- Create a key on its keys page.
- Set the key in your shell:
export THINKTHEN_API_KEY='your key'ThinkThen reads this key from THINKTHEN_API_KEY and from no other variable.
To check which service and model answered, ask for the details with --json and keep the source:
echo 'Please refund my order.' | thinkthen decide --json \ 'Does the customer request a refund?' | jq -c '.source | {backend, model}'Output
{"backend":"systemone","model":"jev-1.13.0"}
There is no config file.
OpenAI
Section titled “OpenAI”The openai backend calls OpenAI's decisions API at https://api.openai.com/v1. Its default model is gpt-6-luna. Each call counts against your OpenAI account.
- Create a key on your OpenAI account's API keys page.
- Set the key, and choose OpenAI for every command in this shell:
export OPENAI_API_KEY='your key'export THINKTHEN_BACKEND=openaiTo use OpenAI for one command only, leave out THINKTHEN_BACKEND and add --backend openai to that command. To use another OpenAI model, set THINKTHEN_MODEL or add --model NAME.
Your own server
Section titled “Your own server”--url sends the same requests to another address, such as a gateway or a model you host. --model names the model that server should use. The server must speak the API of the backend you point at it:
| Backend | Request it sends | Key it sends |
|---|---|---|
systemone |
POST URL/systemone |
THINKTHEN_API_KEY |
openai |
POST URL/decisions |
OPENAI_API_KEY |
Each request is JSON, with the key as a bearer token in the authorization header. ThinkThen doesn't call a chat or completions endpoint.
To point System One at your server for every command in this shell:
export THINKTHEN_API_KEY='your server key'export THINKTHEN_URL=https://models.example.com/v1export THINKTHEN_MODEL=my-modelThree rules apply to the address:
- It must use HTTPS, or plain HTTP to
localhost,127.0.0.1or[::1]. Any otherhttp://address stops withusage.urlbefore a request is sent. THINKTHEN_URLsets only the System One address, taking precedence overTHINKTHEN_BASE_URL. OpenAI readsOPENAI_BASE_URL. An explicit--urlor SDKSettings.urloverrides the address for the chosen backend, including whenTHINKTHEN_BACKENDchooses it.- If your server's certificate comes from your own certificate authority, set
THINKTHEN_CA_FILEto that authority's PEM file. ThinkThen trusts it as well as your system's certificates.
The source in --json names the backend and model, so the check above shows the route each answer took.
Every model setting
Section titled “Every model setting”| Option | Variable | Default |
|---|---|---|
--backend NAME |
THINKTHEN_BACKEND |
systemone |
--model MODEL |
THINKTHEN_MODEL |
jev-1.13.0, or gpt-6-luna for openai |
--url URL |
THINKTHEN_URL (System One), OPENAI_BASE_URL (OpenAI) |
The backend's own address |
| none | THINKTHEN_API_KEY |
The System One key |
| none | OPENAI_API_KEY |
The OpenAI key |
| none | THINKTHEN_CA_FILE |
Your system's certificates only |
THINKTHEN_MODEL applies only to commands. In an SDK, set the model on your client; without an explicit model setting, it uses the chosen backend's default model.
Keys come only from these variables. Keep them in your shell or a secret manager, never in a script or a toolbox file. If the key is missing or blank, ThinkThen stops with usage.key-missing and exit code 2 before it sends anything; Troubleshooting lists that error and the others.
A bar you tuned on one model belongs to that model. If you change the model, check your bars again on your own messages.
Options lists every other setting.