Configure LLM API keys for full graph semantic extraction of markdown, docs PDFs, and images.
Configure LLM API keys to enable semantic extraction of markdown, documentation, PDFs, and images for the full graph.
| Provider | Environment Variable | Model (default) | Free Tier |
|---|---|---|---|
| Google Gemini | GEMINI_API_KEY or GOOGLE_API_KEY | gemini-1.5-flash | 60 req/min, 1M tokens/day |
| OpenAI | OPENAI_API_KEY | gpt-4o-mini | $5 credit new accounts |
| Anthropic | ANTHROPIC_API_KEY | claude-3.5-sonnet | None |
| Moonshot (Kimi) | MOONSHOT_API_KEY | kimi-k2 | Generous |
| DeepSeek | DEEPSEEK_API_KEY | deepseek-chat | Generous |
1# Add to ~/.bashrc, ~/.zshrc, or ~/.profile
2export GEMINI_API_KEY="your-api-key-here"
3
4# Reload
5source ~/.bashrc
6
7# Verify
8echo $GEMINI_API_KEY
1# In project root
2cat > .env << 'EOF'
3GEMINI_API_KEY=your-api-key-here
4EOF
5
6# Or use .env.local for secrets (gitignored)
7echo "GEMINI_API_KEY=your-api-key-here" > .env.local
Graphify auto-loads .env, .env.local, .env.*.local from project root.
1GEMINI_API_KEY="your-key" graphify .
2GEMINI_API_KEY="your-key" graphify update .
1# ~/.config/graphify/config.yaml
2llm:
3 provider: gemini
4 api_key_env: GEMINI_API_KEY
5 model: gemini-1.5-flash
AIza...)1export GEMINI_API_KEY="AIza..."
sk-...)1export OPENAI_API_KEY="sk-..."
sk-ant-...)1export ANTHROPIC_API_KEY="sk-ant-..."
1# Test the key works
2graphify query "test connection" --backend=gemini --model=gemini-1.5-flash
3
4# Should return a response (uses 1 API call)
5
6# Or test with explicit provider
7graphify query "test" --backend=openai --model=gpt-4o-mini
1# 1. Set key (any method above)
2export GEMINI_API_KEY="your-key"
3
4# 2. Build full graph
5mkdir -p graphify-out && touch graphify-out/.graphify-activity
6graphify .
7
8# 3. Query docs + code
9graphify query "what does the youtube-content skill do?"
10
11# 4. Rebuild when docs change
12graphify update .
| Issue | Solution |
|---|---|
no LLM API key found | Check env var name: GEMINI_API_KEY (not GEMINI_KEY) |
Invalid API key | Regenerate key; check no extra spaces/newlines |
Quota exceeded | Wait for reset; switch provider; use --code-only |
Model not found | Use supported model name (see table above) |
Rate limited | Add delay; use --code-only for interim work |
.env.local — Gitignored, per-project, not committed