When using Claude models via LiteLLM proxy, the bundled pi-ai sends
OpenAI-specific parameters (store, max_completion_tokens) that cause
errors with non-OpenAI backends like AWS Bedrock.
This patch adds providerType support to openai-completions.js:
- Check model.providerType to determine if model is OpenAI-native
- Only send OpenAI-specific params to actual OpenAI models
- Use max_tokens instead of max_completion_tokens for proxy models
Users can now configure custom models in ~/.pi/agent/models.json with
providerType: "anthropic" (or "google", etc.) to properly route
requests through LiteLLM to Claude and other non-OpenAI models.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>