# Before You Begin

> **Summary — what this page covers**
> The Day 2 pre-flight. The key difference from Day 1: this day runs on the **Anthropic API
> (pay-as-you-go)**, which is **separate from a Pro/Max subscription** — an API key is required.
> It also covers the Docker dependency (Qdrant + TestContainers) and the **free/local embedding
> alternative** (Ollama) so the RAG section doesn't require a paid OpenAI key. Get everything
> ready before 9:00 AM.

## API access (read carefully — this is different from Day 1)

> A Claude.ai **Pro or Max subscription powers Claude Code (Day 1) but does NOT grant API
> access.** Day 2 needs an **API key from the Anthropic Console.**

| Service | Cost | Notes |
|---|---|---|
| Anthropic API key (Console) | Pay-as-you-go | **Required for every section.** New Console accounts get a small free trial credit — enough for the workshop's calls. |
| OpenAI embedding key (Section 3) | Pay-as-you-go | Used by the RAG embedding step. **Free alternative below.** |

> **Free-first note:** to keep the RAG section on free/local infrastructure, swap the OpenAI
> embedding call for a local model via **Ollama** (`nomic-embed-text`, 768-dim) behind the same
> `EmbeddingService` interface, and set the Qdrant vector size to match (768). Install Ollama, then:
>
> ```bash
> ollama pull nomic-embed-text     # download the embedding model (~270 MB)
> ollama serve                     # run the local server on http://localhost:11434
> ```
>
> No OpenAI key required. You'll point `EmbeddingService` at the local endpoint in Section 3.

## Machine prerequisites

- [ ] **.NET 10 SDK** + the BookTracker solution from Day 1 (cloned and building)
- [ ] **Anthropic API key** set via user-secrets (don't commit it)
- [ ] **Docker Desktop running** — needed for Qdrant (Section 3) and TestContainers (Section 5).
      Pull the image ahead of time so the lab doesn't wait on a download: `docker pull qdrant/qdrant`.
- [ ] **(Optional, free path)** Ollama installed with `nomic-embed-text` pulled

```bash
dotnet user-secrets init --project BookTracker.Api
dotnet user-secrets set "Anthropic:ApiKey" "sk-ant-..." --project BookTracker.Api
```

## A note on cost

Typical workshop usage runs from a **few cents to a couple of dollars** — comfortably inside the
free trial credit on a new Console account. **Prompt caching** (Section 1) and **batch processing**
reduce it further, and using **Haiku** for mechanical work keeps it low. See the
[Models & Cost Reference](14-models-cost-reference.md) for current per-token pricing and the
free/local alternatives.
