RedPlanetHQ/core

Add OpenRouter support as LLM provider

Open

#130 opened on Oct 28, 2025

 (1 comment) (0 reactions) (1 assignee)TypeScript (184 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (1,930 stars)
PR merge metrics
 (PR metrics pending)

Description

Description

Add support for OpenRouter as an LLM provider to enable access to multiple models through a single API.

Files to Look At

Provider Implementation

  • apps/webapp/app/lib/batch/providers/anthropic.ts - Reference for provider structure
  • apps/webapp/app/lib/batch/providers/openai.ts - Another provider example

Configuration

  • docs/providers/ - Provider documentation directory
  • docs/self-hosting/environment-variables.mdx - Where to add new env vars

Implementation Tasks

  • Create apps/webapp/app/lib/batch/providers/openrouter.ts
  • Add OpenRouter API integration
  • Add environment variable configuration (OPENROUTER_API_KEY)
  • Create documentation in docs/providers/openrouter.mdx
  • Update environment variables documentation
  • Add model selection UI if needed

Technical Notes

  1. OpenRouter uses an OpenAI-compatible API, so you can likely extend/adapt the OpenAI provider
  2. API endpoint: https://openrouter.ai/api/v1
  3. Requires HTTP-Referer and X-Title headers for attribution
  4. Supports streaming responses

Resources

Labels

good first issue, enhancement

Contributor guide