Repository navigation
Straitly, and the rule its models endpoint taught - #30
Merged
Merged
Conversation
Straitly is prepaid: the documented error for an exhausted account is 402 `insufficient_credits`, "Your prepaid balance is spent. Add credits and the same key resumes working." So a balance exists. No endpoint returns it — the console's keys page shows the running total beside the cap, and that is what console: points at. The interesting part is the key check. GET /v1/models is the obvious choice and it is the wrong one: it answers 200 with no credential at all, and 200 with a garbage key. Verifying against it would print "key valid" for a key that had been revoked, which is the tool being confidently wrong about the one thing it can tell you about a provider with no balance API — worse than saying nothing. The activity export is documented as a plain authenticated GET, and it answers 401 both with no credential and with a garbage one. Its `since` parameter is set far in the future on purpose, so the export returns no rows: the only thing wanted from it is the authentication result. The manifest says so, because a future reader would otherwise "fix" that timestamp. The same export reports the amount charged per request — spend, not money left — and there is no documented total to subtract it from, so it cannot become a balance. Five conventional balance paths under api.straitly.ai answer 404 unauthenticated, where a real route answers 401. This is the second provider whose models endpoint needs no key (DeepInfra documents theirs that way), so it stops being a thing I happened to notice: CONTRIBUTING now says a verify endpoint has to require the credential and gives the one-line curl that checks it. Fixes nothing; adds one provider and one rule. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
One provider, one rule. Twenty providers now.
Straitly is prepaid — the documented error for an exhausted account is
402 insufficient_credits, "Your prepaid balance is spent. Add credits and the same key resumes working." — but nothing returns the balance. The console's keys page shows the running total beside the cap, which is whereconsole:points.The key check is the interesting part
GET /v1/modelsis the obvious choice and it is the wrong one:Verifying against that would print "key valid" for a key that had been revoked — the tool being confidently wrong about the one thing it can say about a provider with no balance API, which is worse than saying nothing.
The documented activity export answers
401both with no credential and with a garbage one, so it is a real key check:sinceis set far in the future on purpose — the export is asked for no rows, because the only thing wanted from it is the authentication result. The manifest says so, or a future reader will "fix" that timestamp.Why it cannot report a balance
That same export gives the amount charged per request — spend, not money left — and there is no documented total to subtract it from. And five conventional balance paths under
api.straitly.ai(/v1/credits,/v1/balance,/v1/me,/v1/account,/v1/user/balance) answer 404 unauthenticated, where a real route answers 401. So:no-api, dated note, key check.The rule
This is the second provider whose models endpoint needs no key — DeepInfra documents theirs that way (#6). Twice is not a coincidence, so CONTRIBUTING now states it as a rule with the one-line curl that checks it, and points at
straitly.yamlas the worked example of using an odd endpoint when it is the only authenticated one.The README table and its registry-matching test are updated (twenty providers, twelve
no-api), andaipocket auditnames the new host and its query string.go test -race ./...,go vet ./...,gofmt -l .,go mod tidy -diffclean.🤖 Generated with Claude Code