openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

OpenRouter API key is saved but provider still shows usage exhausted

Open limi124 opened this issue 6 months ago • 1 comments

Summary

After saving an OpenRouter API key in LLM Provider settings, OpenHuman still appears to use OpenHuman AI usage and shows the included-usage exhausted message. The settings page shows “A key is currently saved” and “LLM provider settings saved”, but I cannot confirm that requests are routed through my OpenRouter key.

Problem

Expected behavior: after selecting OpenRouter, entering a valid sk-or-v1-... API key, configuring models by role, and clicking Save, OpenHuman should use my OpenRouter account for inference.

Actual behavior: the app continues to show the exhausted usage/subscription prompt, and the API key field only shows “Clear stored key”. It is unclear whether my OpenRouter key is being used or whether OpenHuman AI is still selected internally.

Steps to reproduce:

  1. Install and open OpenHuman v0.53.43.
  2. Choose Local core.
  3. Go to LLM Provider settings.
  4. Select OpenRouter.
  5. Enter a valid OpenRouter API key.
  6. Set models:
    • Reasoning: google/gemini-3-flash-preview
    • Agentic: anthropic/claude-sonnet-4.6
    • Coding: anthropic/claude-sonnet-4.6
    • Summarization: openai/gpt-4o-mini
  7. Click Save.
  8. The page shows:
    • A key is currently saved.
    • LLM provider settings saved.
  9. Try to message the agent.
  10. The app still shows usage exhausted / subscription prompt, or does not clearly route through OpenRouter.

Environment:

  • OpenHuman version: v0.53.43
  • Platform: Windows
  • Mode: Local core
  • Provider selected: OpenRouter

Impact: users who bring their own OpenRouter key cannot tell whether the key is actually being used, and may be blocked by OpenHuman included-usage limits even after configuring an external provider.

Solution (optional)

Please clarify whether “Clear stored key” means the key is saved successfully, and add a visible provider status/test button such as “Test OpenRouter connection”. If external provider routing is expected to work, the usage-exhausted gate should not block requests routed through a user-provided API key.

Acceptance criteria

  • [ ] Repro gone — After saving an OpenRouter key, messages are routed through OpenRouter and no OpenHuman usage-exhausted prompt blocks the request.
  • [ ] Regression safety — Add coverage for switching from OpenHuman provider to OpenRouter with a stored key.
  • [ ] Diff coverage ≥ 80% — the fix PR meets the changed-lines coverage gate.
  • [ ] Provider visibility — The UI clearly shows the active provider and includes either a connection test or a clear error message when routing fails.

Related

No related issue found yet.

limi124 avatar May 18 '26 04:05 limi124

I checked this against current main and the active fix PR. This appears to be the same root cause as #2040 and is now covered by #2053.

Evidence:

  • On origin/main, app/src/hooks/useUsageState.ts still computes the usage-exhausted/budget-complete state from team usage data only. It does not check whether reasoning / agentic / coding are routed to a saved OpenRouter key before setting isAtLimit / isRateLimited / shouldShowBudgetCompletedMessage.
  • #2053 updates that path to read AI settings and suppress the OpenHuman-hosted budget gate when all chat workloads are routed to a non-OpenHuman provider, including OpenRouter.
  • #2053 links both #2040 and #2041, has green CI checks, and is currently open/mergeable but blocked on repo-side review/merge policy.

I would treat #2053 as the canonical fix rather than opening a duplicate PR. After it lands, the useful verification is: save an OpenRouter key, route all chat workloads to OpenRouter models, refresh chat, and confirm the usage-exhausted prompt no longer blocks the flow.

honor2030 avatar May 18 '26 07:05 honor2030