Skip to content

You're out of credits #5127

Closed
Closed

Description

@gitmeatarru

hi

today, a new error appeared that I can't get rid of.

Image

the agent refuses to work because it thinks I don't have enough balance, but that's not true.
Moreover, it doesn't even reach the point of using the key, according to the openrouter key statistics.

Image

as you can see, it was used 40 minutes ago, but I just tried to tell it to keep going.
I also recreated the keys without any limits, but it didn't help.

In another agent system, everything works without any errors.

Today, I received another strange error indicating that I exceeded the daily limit of $10, which is not true because I don't have that much money in my balance.

Image

output, 100% error in your application!!!

I'm using the desktop version for Windows 0.63.0

Implementation Plan

Triage Assessment

  • Valid bug: User on desktop v0.63.0 (Windows) with OpenRouter BYOK hits cost budget exceeded: Day spend USD 10.0136 >= limit USD 10.0000.
  • NOT a duplicate of Managed inference says "out of credits" while the account shows $5.25 in promotional credits #4357 (which was managed promotional credit spendability — different root cause, different code path).
  • Contributor samrusani identified the correct root cause (local daily cost-budget enforcement) and has offered to implement pending policy confirmation.

Proposed Scope

  • In-scope: Resolve the policy question (should BYOK requests bypass the local daily cost limit?), then either (a) scope enforcement by routing/funding mode so BYOK bypasses the limit, or (b) correct the error message to reflect that the limit applies to BYOK too and surface the applicable budget setting.
  • Non-goal: Managed credit balance issues (tracked by other issues).

Implementation Steps

  1. Policy decision: Confirm whether BYOK requests should bypass the local daily cost limit (OPENHUMAN_DAILY_SPEND_LIMIT / local budget enforcement). If yes, scope enforcement to managed routes only. If no, proceed to step 2.
  2. If BYOK should bypass: Trace the spend-tracking path in src/openhuman/inference/ or the budget-checking code. Gate budget enforcement behind a check that the request uses managed routing. Add a unit test.
  3. If BYOK should honor the limit: Update the error message from the misleading managed-credits exhaustion text to a budget-specific message that names the applicable setting. Update src/openhuman/channels/providers/web_errors.rs if the error comes through that path.
  4. Add regression test covering the chosen behavior.

Verification

  • cargo test -p openhuman passes.
  • Configure OpenRouter BYOK, send chat turns, confirm no budget error until/unless the daily limit applies as intended.
  • Configure managed routing, confirm budget enforcement still works as before.

Risks and Open Questions

  • The policy question must be resolved by a maintainer before implementation proceeds. samrusani requested maintainer confirmation in the issue comments.
  • The exact file where the daily cost budget is enforced needs to be confirmed — may be in src/openhuman/inference/ or the provider layer.

Acceptance Criteria

  • Policy decision documented in the issue (BYOK bypasses or honors local daily budget)
  • Implementation matches the policy decision
  • Error message is accurate and actionable regardless of the policy choice
  • Unit/integration tests cover the new behavior

Activity

  1. added theissue type on Jul 22, 2026
  2. gitmeatarru commented on Jul 22, 2026

    @gitmeatarru
    Author

    llm settings

    Image
  3. samrusani commented on Jul 22, 2026

    @samrusani
    Contributor

    I would like to work on this, pending confirmation of the intended budget behavior.

    The screenshots show Use Your Own Models with OpenRouter selected, while the underlying error is model error: limit exceeded: cost budget exceeded: Day spend USD 10.0136 >= limit USD 10.0000. This appears to be OpenHuman local daily cost-budget enforcement, rather than the managed-credit balance described by the chat response.

    Could a maintainer confirm which contract is intended?

    1. BYO-provider requests should bypass the local daily cost limit. I can scope enforcement by routing/funding mode and add regression coverage.
    2. The local daily limit intentionally applies to BYO providers. I can correct the exhausted-managed-credits message and make the applicable budget setting clear.

    Once that behavior is confirmed, I can prepare the narrow fix with happy-path and failure/edge tests.

  4. moved this from Todo to In progress in Team Openhumanon Jul 27, 2026
  5. moved this from In progress to Done in Team Openhumanon Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions