Back to ChatToMap

Configuration

Configure the CLI using environment variables. API keys are required for most commands beyond the free scan.

Environment Variables

Set these in your shell profile (~/.bashrc, ~/.zshrc) or a .env file:

VariableDescriptionRequiredDefault
OPENROUTER_API_KEYOpenRouter API key for AI classification (recommended, cheapest)For classification
ANTHROPIC_API_KEYAnthropic API key for direct Claude accessAlternative to OpenRouter
OPENAI_API_KEYOpenAI API key for embeddings and semantic searchFor embeddings
GOOGLE_MAPS_API_KEYGoogle Maps API key for geocoding locationsFor geocoding
CLASSIFIER_MODELAI model to use for classificationOptionalgemini-2.5-flash
HOME_COUNTRYDefault home country for geocoding biasOptional
TIMEZONEDefault timezone for date parsingOptional
CHAT_TO_MAP_CACHE_DIRCustom cache directory locationOptional~/.cache/chat-to-map

Quick Setup

Add your API keys to your shell profile:

# Add to ~/.zshrc or ~/.bashrc
export OPENROUTER_API_KEY="sk-or-..."
export GOOGLE_MAPS_API_KEY="AIza..."

# Optional: for embeddings
export OPENAI_API_KEY="sk-..."

AI Model Selection

The CLASSIFIER_MODEL environment variable controls which AI model is used for classification. The model ID determines which provider and API key is required:

Model IDProviderAPI ModelRequired KeyNotes
gemini-2.5-flashOpenRoutergoogle/gemini-2.5-flashOPENROUTER_API_KEYCheapest
haiku-4.5Anthropicclaude-haiku-4-5ANTHROPIC_API_KEYFast
haiku-4.5-orOpenRouteranthropic/claude-3-5-haiku-latestOPENROUTER_API_KEYFast
gpt-5-miniOpenAIgpt-5-miniOPENAI_API_KEYBalanced

Example: Use Claude directly instead of OpenRouter:

export CLASSIFIER_MODEL="haiku-4.5"

Cache Directory

By default, the CLI caches results in ~/.cache/chat-to-map/. You can customize this:

# Via environment variable
export CHAT_TO_MAP_CACHE_DIR="/custom/path"

# Or per-command
chat-to-map analyze chat.zip --cache-dir /tmp/cache

To skip caching entirely and regenerate all results:

chat-to-map analyze chat.zip --no-cache

Home Country & Timezone

These settings help with geocoding bias (preferring locations in your country) and date parsing. They're auto-detected by default but can be overridden:

# Via environment variables
export HOME_COUNTRY="New Zealand"
export TIMEZONE="Pacific/Auckland"

# Or per-command
chat-to-map analyze chat.zip -c "United States" --timezone "America/New_York"

Getting API Keys

OpenRouter (Recommended)

OpenRouter provides access to multiple AI models with a single API key and often lower prices.

  1. Sign up at openrouter.ai
  2. Add credits to your account
  3. Copy your API key from the dashboard

Google Maps

Required for geocoding locations to coordinates.

  1. Go to the Google Cloud Console
  2. Create a project or select an existing one
  3. Enable the "Geocoding API"
  4. Create an API key and restrict it to the Geocoding API

OpenAI (Optional)

Only needed if you want to use embeddings for semantic search (improves candidate detection).

  1. Sign up at platform.openai.com
  2. Add credits to your account
  3. Create an API key in the dashboard