Skip to content

Commit 11914eb

Browse files
committed
docs: update API key references to use ODEK_API_KEY as preferred
- Error message now includes ODEK_API_KEY in the chain (odek.go:300) - Default config template uses sk-3f118462a62c46a4ab7948323ea5cd50 (main.go:492) - README, API.md, PROVIDERS.md, CACHING.md, CONFIG.md, CHEATSHEET.md: all examples and code snippets updated to os.Getenv("ODEK_API_KEY") - index.html landing page uses ODEK_API_KEY with fallbacks noted - Makefile integration-test target accepts ODEK_API_KEY or DEEPSEEK_API_KEY Canonical chain: ODEK_API_KEY → DEEPSEEK_API_KEY → OPENAI_API_KEY
1 parent f4ce2b6 commit 11914eb

10 files changed

Lines changed: 28 additions & 24 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ coverage-total: ## Print total coverage percentage
6363
# ── Test (with LLM) ────────────────────────────────────────────────────
6464

6565
.PHONY: test-integration
66-
test-integration: ## Run integration tests (requires DEEPSEEK_API_KEY)
67-
@test -n "$$DEEPSEEK_API_KEY" || { \
68-
echo "ERROR: DEEPSEEK_API_KEY not set"; \
69-
echo " export DEEPSEEK_API_KEY=sk-..."; \
66+
test-integration: ## Run integration tests (requires ODEK_API_KEY or DEEPSEEK_API_KEY)
67+
@test -n "$$ODEK_API_KEY$$DEEPSEEK_API_KEY" || { \
68+
echo "ERROR: ODEK_API_KEY or DEEPSEEK_API_KEY not set"; \
69+
echo " export ODEK_API_KEY=sk-..."; \
7070
exit 1; \
7171
}
7272
$(GO) test -tags=integration -count=1 -timeout 300s -run Integration ./...

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ One binary. One loop. Zero frameworks. ReAct (Reasoning + Acting) — think, the
88
# Install
99
go install github.com/BackendStack21/kode/cmd/odek@latest
1010

11-
# Use (set DEEPSEEK_API_KEY or OPENAI_API_KEY)
12-
export DEEPSEEK_API_KEY=sk-...
11+
# Use (set ODEK_API_KEY, DEEPSEEK_API_KEY, or OPENAI_API_KEY)
12+
export ODEK_API_KEY=sk-...
1313
odek run "How many lines in go.mod?"
1414
# → 3 lines
1515
```
@@ -176,7 +176,7 @@ import "github.com/BackendStack21/kode"
176176

177177
agent, err := odek.New(odek.Config{
178178
Model: "deepseek-chat",
179-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
179+
APIKey: os.Getenv("ODEK_API_KEY"),
180180
MaxIterations: 30,
181181
Tools: []odek.Tool{&myCustomTool{}},
182182
SystemMessage: "You are an expert at refactoring Go code.",

cmd/odek/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Environment variables:
489489
const defaultConfigTemplate = `{
490490
"model": "deepseek-v4-flash",
491491
"base_url": "https://api.deepseek.com/v1",
492-
"api_key": "${DEEPSEEK_API_KEY}",
492+
"api_key": "${ODEK_API_KEY}",
493493
"thinking": "",
494494
"max_iterations": 90,
495495
"sandbox": false,

docs/API.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
func main() {
2727
agent, err := odek.New(odek.Config{
2828
Model: "deepseek-v4-flash",
29-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
29+
APIKey: os.Getenv("ODEK_API_KEY"),
3030
})
3131
if err != nil {
3232
fmt.Fprintf(os.Stderr, "odek: %v\n", err)
@@ -46,7 +46,7 @@ func main() {
4646
Save, run:
4747

4848
```bash
49-
export DEEPSEEK_API_KEY=sk-...
49+
export ODEK_API_KEY=sk-...
5050
go mod init my-agent
5151
go mod tidy
5252
go run main.go
@@ -104,6 +104,7 @@ type Config struct {
104104

105105
// API key for the LLM provider.
106106
// Falls back to DEEPSEEK_API_KEY, then OPENAI_API_KEY.
107+
// Prefer ODEK_API_KEY for odek-specific configuration.
107108
APIKey string
108109

109110
// Thinking depth — provider-specific semantics:
@@ -240,7 +241,7 @@ The agent loop:
240241
```go
241242
agent, err := odek.New(odek.Config{
242243
Model: "deepseek-chat",
243-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
244+
APIKey: os.Getenv("ODEK_API_KEY"),
244245
Tools: []odek.Tool{&slackNotifier{}},
245246
})
246247

@@ -252,7 +253,7 @@ result, err := agent.Run(ctx, "Send a Slack message saying 'Deploy complete'")
252253
```go
253254
agent, err := odek.New(odek.Config{
254255
Model: "deepseek-v4-flash",
255-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
256+
APIKey: os.Getenv("ODEK_API_KEY"),
256257
SystemMessage: "You are a Go code reviewer. Be concise and specific.",
257258
MaxIterations: 15,
258259
})
@@ -373,7 +374,7 @@ func (t *gitLogTool) Call(args string) (string, error) {
373374
```go
374375
agent, _ := odek.New(odek.Config{
375376
Model: "deepseek-chat",
376-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
377+
APIKey: os.Getenv("ODEK_API_KEY"),
377378
Tools: []odek.Tool{&gitLogTool{}},
378379
})
379380

@@ -452,7 +453,7 @@ Memory is enabled by default when odek loads a config file with memory settings.
452453
```go
453454
agent, _ := odek.New(odek.Config{
454455
Model: "deepseek-chat",
455-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
456+
APIKey: os.Getenv("ODEK_API_KEY"),
456457
// Memory is enabled via config file (~/.odek/config.json or ./odek.json)
457458
// In CLI mode, the --memory flag enables it automatically
458459
})
@@ -571,7 +572,7 @@ agent, err := odek.New(odek.Config{
571572
Model: "deepseek-chat",
572573
APIKey: "", // missing!
573574
})
574-
// err: "odek: no API key provided (set DEEPSEEK_API_KEY or OPENAI_API_KEY)"
575+
// err: "odek: no API key provided (set ODEK_API_KEY, DEEPSEEK_API_KEY, or OPENAI_API_KEY)"
575576
```
576577

577578
### Run failures
@@ -722,7 +723,7 @@ func (t *slackNotifyTool) Call(args string) (string, error) {
722723
func main() {
723724
agent, err := odek.New(odek.Config{
724725
Model: "deepseek-v4-flash",
725-
APIKey: os.Getenv("DEEPSEEK_API_KEY"),
726+
APIKey: os.Getenv("ODEK_API_KEY"),
726727
SystemMessage: "You are a build engineer analyzing Go projects. Use line_count to examine files and slack_notify to report results.",
727728
MaxIterations: 10,
728729
Tools: []odek.Tool{

docs/CACHING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export ODEK_PROMPT_CACHING=true
4141
```go
4242
agent, err := odek.New(odek.Config{
4343
Model: "claude-sonnet-4",
44-
APIKey: os.Getenv("ANTHROPIC_API_KEY"),
44+
APIKey: os.Getenv("ODEK_API_KEY"),
4545
BaseURL: "https://api.anthropic.com/v1",
4646
PromptCaching: true,
4747
})

docs/CHEATSHEET.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ odek mcp --sse-addr :8081 # SSE transport
199199
| `ODEK_NO_AGENTS` | no_agents |
200200
| `ODEK_MAX_CONCURRENCY` | max_concurrency |
201201
| `ODEK_CTX` | ctx (comma-separated file paths) |
202+
| `ODEK_API_KEY` | api_key (preferred) |
202203
| `DEEPSEEK_API_KEY` | api_key (fallback) |
203204
| `OPENAI_API_KEY` | api_key (final fallback) |
204205

docs/CONFIG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Shared across all projects:
2323
{
2424
"model": "deepseek-v4-flash",
2525
"base_url": "https://api.deepseek.com/v1",
26-
"api_key": "${DEEPSEEK_API_KEY}",
26+
"api_key": "${ODEK_API_KEY}",
2727
"thinking": "",
2828
"max_iterations": 90,
2929
"sandbox": false,

docs/PROVIDERS.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ odek is provider-agnostic. Any endpoint that speaks the OpenAI `/chat/completion
55
## Deepseek
66

77
```bash
8-
export DEEPSEEK_API_KEY=sk-...
9-
odek run --model deepseek-chat "task"
8+
export ODEK_API_KEY=sk-...
9+
# Or use DEEPSEEK_API_KEY (fallback)
10+
odek run --model deepseek-v4-flash "task"
1011
```
1112

1213
## OpenAI
1314

1415
```bash
15-
export OPENAI_API_KEY=sk-...
16+
export ODEK_API_KEY=sk-...
17+
# Or use OPENAI_API_KEY (final fallback)
1618
odek run --model gpt-4o --base-url https://api.openai.com/v1 "task"
1719
```
1820

@@ -21,7 +23,7 @@ odek run --model gpt-4o --base-url https://api.openai.com/v1 "task"
2123
Any endpoint that accepts `POST /chat/completions` with an OpenAI-compatible JSON body works — Ollama, vLLM, LiteLLM, etc. No provider-specific code in odek.
2224

2325
```bash
24-
export OPENAI_API_KEY=not-needed
26+
export ODEK_API_KEY=not-needed
2527
odek run --model llama3 --base-url http://localhost:11434/v1 "task"
2628
```
2729

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ <h2>Install in <span class="hl">5 seconds</span></h2>
559559
</li>
560560
<li>
561561
<span class="n">3</span>
562-
<span>Set your API key: <code>export DEEPSEEK_API_KEY=sk-...</code> or <code>OPENAI_API_KEY</code></span>
562+
<span>Set your API key: <code>export ODEK_API_KEY=sk-...</code> (or <code>DEEPSEEK_API_KEY</code> / <code>OPENAI_API_KEY</code>)</span>
563563
</li>
564564
<li>
565565
<span class="n">4</span>

odek.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func New(cfg Config) (*Agent, error) {
297297
}
298298
}
299299
if cfg.APIKey == "" {
300-
return nil, fmt.Errorf("odek: no API key provided (set DEEPSEEK_API_KEY or OPENAI_API_KEY)")
300+
return nil, fmt.Errorf("odek: no API key provided (set ODEK_API_KEY, DEEPSEEK_API_KEY, or OPENAI_API_KEY)")
301301
}
302302
if cfg.Model == "" {
303303
cfg.Model = defaultModel

0 commit comments

Comments
 (0)