Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/TECHNICAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Provider selection does not need to live in environment variables. Persist `prov
`provider.model`, `provider.base_url`, and `provider.request_timeout_seconds` in the TOML config,
or override them per invocation with `--provider`, `--model`, `--base-url`, and
`--provider-timeout`. Foundation CLI currently supports:
- `codex` via `codex exec`, reusing the local Codex ChatGPT login rather than an OpenAI API key
- `openai` via the OpenAI Responses API
- `ollama` via the Ollama Chat API, including local Ollama at `http://localhost:11434/api` and Ollama Cloud at `https://ollama.com/api`

Expand Down Expand Up @@ -174,6 +175,19 @@ max_timeout_seconds = 3600
mode = "prompt"
```

Example Codex / ChatGPT subscription config:

```toml
[provider]
name = "codex"
model = "gpt-5.5"
request_timeout_seconds = 180
```

This route shells out to `codex exec --json` in a read-only sandbox and reuses
the local Codex ChatGPT login. It does not read `OPENAI_API_KEY`; use the
`openai` provider only when you want direct OpenAI Platform API billing.

Example Ollama Cloud config:

```toml
Expand Down
31 changes: 31 additions & 0 deletions docs/how-to-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,37 @@ Then verify the setup:

You want to see `Provider: ollama`, `Base URL: https://ollama.com/api`, and a secret lookup line saying credentials resolved from `$OLLAMA_API_KEY`.

## Codex / ChatGPT subscription

To use your ChatGPT/Codex subscription instead of an OpenAI API key, sign in to
the Codex CLI with your ChatGPT account, then use the `codex` provider:

```bash
codex
```

Choose ChatGPT sign-in when Codex prompts for authentication. Then configure
Foundation:

```bash
cat > "$HOME/Library/Application Support/foundation/config.toml" <<'EOF'
[provider]
name = "codex"
model = "gpt-5.5"
request_timeout_seconds = 180
EOF
```

Verify with:

```bash
./scripts/uv run foundation doctor
```

You want to see `Provider: codex`, `Base URL: codex://local`, and a secret
lookup line saying the provider uses local Codex ChatGPT login. This route does
not use `OPENAI_API_KEY`.

## OpenAI

To use OpenAI instead, use this provider config:
Expand Down
Loading
Loading