Skip to content

Straitly, and the rule its models endpoint taught - #30

Merged
naturalmoods merged 1 commit into
mainfrom
provider-straitly
Aug 18, 2026
Merged

naturalmoods merged 1 commit into
mainfrom
provider-straitly

Conversation

@naturalmoods

Copy link
Copy Markdown
Owner

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 where console: points.

The key check is the interesting part

GET /v1/models is the obvious choice and it is the wrong one:

$ curl -s -o /dev/null -w '%{http_code}' https://api.straitly.ai/v1/models
200                                     # no credential at all
$ curl … -H 'Authorization: Bearer sk-not-a-real-key-000' …
200                                     # garbage key

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 401 both with no credential and with a garbage one, so it is a real key check:

GET https://app.straitly.ai/api/activity/export?format=json&since=4000000000

since is 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.yaml as 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), and aipocket audit names the new host and its query string.

go test -race ./..., go vet ./..., gofmt -l ., go mod tidy -diff clean.

🤖 Generated with Claude Code

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>
@naturalmoods
naturalmoods merged commit f938444 into main Aug 18, 2026
5 checks passed
@naturalmoods
naturalmoods deleted the provider-straitly branch August 18, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant