import{c as t,Q as s,j as a,m as i}from"./chunks/framework.BPKcPtvA.js";const c=JSON.parse('{"title":"API Key Setup Guide","description":"","frontmatter":{},"headers":[],"relativePath":"api-keys.md","filePath":"api-keys.md","lastUpdated":1780488246000}'),n={name:"api-keys.md"};function r(o,e,h,l,p,d){return s(),a("div",null,[...e[0]||(e[0]=[i(`
Every lab needs at least one LLM API key. If you don't have one, the mock LLM handles everything offline.
All labs include automatic mock LLM fallback. Run without any setup:
python labs/L1-first-agent/solution.py test.txt "Summarize this file"The mock client returns realistic responses. Your code runs identically with real or mock LLM.
Best for: All course labs. Claude Sonnet is the default model used throughout.
Cost: Free credits available on signup. Labs cost ~$0.01-0.05 each with Sonnet.
Get key: console.anthropic.com
Set it:
# Windows PowerShell
$env:ANTHROPIC_API_KEY="sk-ant-..."
# Mac/Linux
export ANTHROPIC_API_KEY="sk-ant-..."Best for: Labs using the OpenAI SDK.
Cost: Free credits on signup. GPT-4o costs ~$0.02-0.10 per lab.
Get key: platform.openai.com/api-keys
Set it:
export OPENAI_API_KEY="sk-..."Best for: Cost-sensitive experimentation. Gemini Flash is $0.15/M tokens.
Cost: Free tier available (60 requests/minute).
Get key: aistudio.google.com/apikey
Set it:
export GEMINI_API_KEY="..."Best for: Accessing multiple models from one key.
Cost: Pay-as-you-go. Free tier available for some models.
Get key: openrouter.ai/keys
Set it:
export OPENROUTER_API_KEY="sk-or-..."| If you... | Get |
|---|---|
| Want the simplest setup | None (use mock LLM) |
| Want to follow the course exactly | Anthropic (Claude Sonnet) |
| Already have OpenAI access | OpenAI (GPT-4o or o3-mini) |
| Want the cheapest option | Gemini (Flash is $0.15/M) |
| Want to try different models | OpenRouter (one key for everything) |
# Anthropic
python -c "from anthropic import Anthropic; c=Anthropic(); print(c.messages.create(model='claude-sonnet-4', max_tokens=50, messages=[{'role':'user','content':'hi'}]).content)"
# OpenAI
python -c "from openai import OpenAI; c=OpenAI(); print(c.chat.completions.create(model='gpt-4o', messages=[{'role':'user','content':'hi'}]).choices[0].message.content)"
# Mock (no key needed)
python -c "from mock_llm import MockAnthropic; c=MockAnthropic(); print(c.messages.create(messages=[{'role':'user','content':'hi'}]).content[0].text)"| Provider | Free Credits | Rate Limit |
|---|---|---|
| Anthropic | $5-10 signup credit | Varies by model |
| OpenAI | $5-18 signup credit | Varies by tier |
| Gemini | Free tier (60 req/min) | 60 requests/minute |
| OpenRouter | Varies by model | Varies |
The course uses ~$0.50-2.00 in API costs total with Anthropic, or $0 with the mock LLM.
`,31)])])}const g=t(n,[["render",r]]);export{c as __pageData,g as default};