Repository navigation
Require a paid plan with usage remaining for embeddings - #1542
Merged
Merged
Conversation
/v1/embeddings only checked guests. A free registered account, or a paid one with no usage left, could call it without limit beyond the shared request rate limiter, and usage was only published after the provider call. The request model was also forwarded as sent. Embeddings now use the same billing snapshot as Chat Completions, for JWT and API-key callers alike: a paid plan with usage remaining in the pool the call is billed to. A missing or failed billing answer is a retryable 503 instead of access. Only nomic-embed-text is accepted, and validation runs before billing or the provider is contacted. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
POST /v1/embeddingsonly checked guest accounts. A free registered account, or a paid account with no usage left, passed straight through to the provider. Usage was published after the call, but nothing read the balance before it, so the only bound was the shared request rate limiter. The requestmodelwas also forwarded as sent.No Maple client calls this route for its own features. It is reachable through the SDKs, the proxy and the Maple Work local API.
Change
chat_billing_access), for JWT and API-key callers alike: a paid plan with usage remaining in the pool the call is billed to.nomic-embed-textis accepted; any other model is a 400.usage_limit_reachedmodel_not_available_on_planClient impact
Paid callers using the default or
nomic-embed-textmodel see no change. Callers that sent another model name now get a 400.Validation
cargo fmt --check,cargo clippy --all-targets -- -D warningsin the pinned#cishell🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.