Skip to content

feat: support custom OpenAI-compatible API endpoints#18

Open
jelloeater-agent wants to merge 4 commits into
roscrl:mainfrom
jelloeater-agent:feat/custom-api-endpoint
Open

feat: support custom OpenAI-compatible API endpoints#18
jelloeater-agent wants to merge 4 commits into
roscrl:mainfrom
jelloeater-agent:feat/custom-api-endpoint

Conversation

@jelloeater-agent

Copy link
Copy Markdown

What

Adds a configurable Base URL setting so the plugin works with any OpenAI-compatible endpoint — not just OpenRouter.

Why

Users want to run against local models (Ollama, LM Studio, vLLM) or through a compression proxy (Headroom). The endpoint was hardcoded to .

Changes

  • New apiBaseUrl setting — persisted, defaults to https://openrouter.ai/api/v1 (backward compatible)
  • Request URL built from base URL{baseUrl}/chat/completions replaces the hardcoded URL
  • Auth header is conditional — only sent when an API key is configured (Ollama/Headroom don't need one)
  • API key validation relaxed — only enforced when base URL contains openrouter
  • Settings UI updated — new "Provider" group with Base URL field, OpenRouter links shown conditionally

Testing

./gradlew buildPlugin  # builds plugin zip
  1. Install plugin from build/distributions/
  2. Ollama: set Base URL to http://localhost:11434/v1, add model llama3, trigger with Shift+Ctrl+S
  3. Headroom: run headroom proxy --port 8787, set Base URL to http://localhost:8787/api/v1, trigger
  4. OpenRouter: leave defaults — existing behavior unchanged

…m, etc.)

- Add configurable apiBaseUrl setting (defaults to OpenRouter)
- Build request URL from base URL instead of hardcoding
- Make Authorization header conditional (skipped when API key is empty)
- API key validation only enforced for OpenRouter
- New 'Provider' group in settings UI with Base URL field
- OpenRouter-specific links shown conditionally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant