Luca Sacchi Ricciardi
d0f530f757
docs: update AI Pipeline spec to use OpenRouter instead of OpenAI direct
Migrated from OpenAI direct API to OpenRouter for multiple advantages:
Cost Optimization:
- Reduced cost by ~25%: /bin/bash.00015/call (vs /bin/bash.0002/call OpenAI)
- Monthly estimate: ~/bin/bash.15 for 1000 calls (vs /bin/bash.20)
Provider Benefits:
- Access to 300+ AI models (OpenAI, Anthropic, Google, etc.)
- Automatic fallback between providers for 99.9% uptime
- Single API key for all providers
- Unified API interface
Technical Changes:
- Updated endpoint: api.openai.com → openrouter.ai/api/v1
- Model format: gpt-4o-mini → openai/gpt-4o-mini
- Added required headers: HTTP-Referer, X-Title
- Environment variables: OPENAI_API_KEY → OPENROUTER_API_KEY
+ OPENROUTER_SITE_URL (for OpenRouter ranking)
+ OPENROUTER_APP_NAME
Added Sections:
- 3.1 Why OpenRouter? (benefits comparison)
- 3.5 Model Fallback (automatic provider switching)
- Updated all code examples with OpenRouter integration
- Updated test cases (openai_client → openrouter_client)
- Updated cost estimates throughout document
References updated to OpenRouter documentation.
Refs: OpenRouter docs https://openrouter.ai/docs