/claim #1929

Summary

This PR implements full support for OpenRouter as an LLM provider within the Archestra platform. It includes backend integration (proxy adapter, client configuration), frontend updates (logo, settings UI), and comprehensive test coverage. Additionally, this PR resolves critical issues with API key validation in the testing environment and restores standard behavior for the MCP server runtime.

Key Changes

1. OpenRouter Integration

  • Backend:
    • Added OpenRouterAdapter implementing LLMProvider, LLMRequestAdapter, LLMResponseAdapter, and LLMStreamAdapter.
    • Updated LLMClient to support OpenRouter model detection, API key resolution, and client instantiation.
    • Added new types and schemas for OpenRouter API interaction.
    • Registered new proxy routes for OpenRouter (/api/proxy/v2/openrouter).
  • Frontend:
    • Added OpenRouter logo and updated Supported LLM Providers documentation.
    • Enabled OpenRouter configuration in the “Settings > API Keys” UI.

2. Fixes & Improvements

  • API Key Validation: Fixed a regression where API key validation was bypassed or mocked incorrectly during tests. The system now performs real validation where appropriate or uses correctly configured mock servers.
  • WireMock Mappings: Updated WireMock mappings to correctly simulate OpenRouter responses and fix tool name discrepancies (e.g., print_archestra_test) during E2E tests.

Testing Strategy

To ensure stability and correctness, the following test scripts were created and used:

  • run_tests_sequentially.sh: A comprehensive script that executes all project tests in a sequential manner (Shared -> Backend -> Frontend -> E2E). It manages resource cleanup (ports 9000, 3000, 9050) and includes delays to prevent resource contention on local machines.
  • run_e2e_phase.sh: A standalone script focused solely on running the E2E test suite. It sets up the specific environment variables, WireMock containers, and database state required for full integration testing.
  • src/scripts/cleanup-test-data.ts: A utility script to reliably clean up test artifacts (API keys, MCP servers) from the database between test runs.

Verification

  • Unit Tests: Added for OpenRouter adapter logic.
  • E2E Tests: Verified successfully using the new test scripts.
    • tests/api/chat-settings.spec.ts: Validated CRUD operations for API keys.
    • tests/api/mcp-gateway.spec.ts: Validated tool discovery and MCP server interaction.
    • Targeted OpenRouter tests passed successfully.

Demo video (Tests and UI chat): https://youtu.be/_1WOfX0c95g

Demo video (UI API key and chat): https://youtu.be/965fLwnsXzM

Related Issue

Fixes #1929

Claim

Total prize pool $50
Total paid $0
Status Pending
Submitted February 03, 2026
Last updated February 03, 2026

Contributors

SA

Samer Attrah

@Samir-atra

100%

Sponsors

AR

Archestra

@archestra-ai

$50