Skip to content

fix: don't try to mint a key for a brand-new AI/ML API account - #6

Merged
Lookoff-AIMLAPI merged 1 commit into
mainfrom
fix-aimlapi-oauth-signup-no-key
Aug 25, 2026
Merged

fix: don't try to mint a key for a brand-new AI/ML API account#6
Lookoff-AIMLAPI merged 1 commit into
mainfrom
fix-aimlapi-oauth-signup-no-key

Conversation

@Lookoff-AIMLAPI

Copy link
Copy Markdown
Member

A freshly created passwordless account on AI/ML API is inactive (`isActive: false`) until its first top-up — confirmed live against production: `POST /v1/keys` with a brand-new account's session token returns `403 Forbidden` (`USER_SCOPE.active` required). So the sign-up branch's key mint could never succeed — it was dead on arrival for every genuinely new user.

Register the account (still useful — it exists for the user's next visit) but stop there with a clear message pointing at https://aimlapi.com/app to add credit, then `/login` again to sign in through the code-verification path, which does mint successfully (verified: existing-account sign-in reaches `POST /v1/keys` with an active session and succeeds).

Test plan

  • Updated `aimlapi-oauth.test.ts` sign-up case: expects the account-created message, asserts `POST /v1/keys` is never called.
  • Full `packages/ai` suite passes.

A freshly created passwordless account is inactive (isActive: false) until
its first top-up — POST /v1/keys requires USER_SCOPE.active and returns 403
for it, so the sign-up branch's key mint could never succeed. Register the
account (still useful — it exists for the user's next visit) but stop
there with a clear message pointing at https://aimlapi.com/app to add
credit, then /login again to sign in through the code-verification path,
which does mint successfully.
@Lookoff-AIMLAPI
Lookoff-AIMLAPI merged commit 50b6136 into main Aug 25, 2026
3 checks passed
@Lookoff-AIMLAPI
Lookoff-AIMLAPI deleted the fix-aimlapi-oauth-signup-no-key branch August 25, 2026 12:06
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