jackwener/OpenCLI · error · CommandExecutionError
Midjourney generation requires an active subscription.
Error message
Midjourney generation requires an active subscription.
What it means
assertGenerationEntitlement checks the account payload from subscriptions-check and throws CommandExecutionError when status !== 'active' or plan.type is missing. Generation is impossible without an active subscription, so the CLI fails fast with a pointer to the account page instead of submitting doomed jobs.
Source
Thrown at clis/midjourney/utils.js:301
}
throw new CommandExecutionError(`Midjourney API request failed: ${message}`);
}
}
export async function getMidjourneyAccount(page) {
const account = await midjourneyJson(page, '/api/subscriptions-check');
if (!account || typeof account !== 'object' || Array.isArray(account)) {
throw new CommandExecutionError('Midjourney subscription endpoint returned a malformed payload');
}
if (!account.user_id) {
throw new AuthRequiredError(MIDJOURNEY_DOMAIN, 'Log into Midjourney in Chrome, then retry.');
}
return account;
}
export function assertGenerationEntitlement(account) {
if (account.status !== 'active' || !account.plan?.type) {
throw new CommandExecutionError(
'Midjourney generation requires an active subscription.',
`Check the account at ${MIDJOURNEY_URL}/account.`,
);
}
const remaining = Number(account.total_credits ?? account.credits_total ?? 0);
if (!(remaining > 0) && !account.abilities?.can_relax) {
throw new CommandExecutionError(
'No Midjourney generation credits remain for this billing period.',
`Check usage at ${MIDJOURNEY_URL}/account.`,
);
}
}
export async function fetchHistory(page, userId, limit = 20) {
return (await fetchHistoryPage(page, userId, limit)).data;
}
export async function fetchHistoryPage(page, userId, limit = 20, cursor = null) {View on GitHub (pinned to 49907e53dc)
Solutions
- Visit midjourney.com/account and renew/reactivate the subscription.
- Verify payment method is valid and the latest invoice was paid.
- Confirm the account payload actually shows status 'active'; if it does but the error still fires, the CLI's field expectations may be outdated — update the library.
Example fix
// before
await assertGenerationEntitlement(account); // throws on lapsed plan
// after
if (account.status !== 'active') {
console.error('Subscription inactive — renew at midjourney.com/account');
process.exit(1);
}
await assertGenerationEntitlement(account); Defensive patterns
Strategy: validation
Validate before calling
const account = await getMidjourneyAccount(page);
const canGenerate = account.status === 'active' && Boolean(account.plan?.type);
if (!canGenerate) console.error('Subscription inactive — renew at midjourney.com/account before generating.'); Type guard
function hasActiveSubscription(account) {
return account != null && typeof account === 'object' && account.status === 'active' &&
typeof account.plan === 'object' && account.plan !== null && Boolean(account.plan.type);
} Try / catch
try {
assertGenerationEntitlement(account);
} catch (err) {
if (/requires an active subscription/.test(err.message)) {
console.error('Renew your plan at midjourney.com/account.');
} else throw err;
} Prevention
- Check subscription status before batch generation runs
- Keep billing payment methods current
- Call assertGenerationEntitlement early, before any submit
- Watch for plan-field renames when updating Midjourney integrations
When it happens
Trigger: Called after getMidjourneyAccount with account.status not equal to 'active' or account.plan?.type falsy — e.g. trial ended, subscription lapsed, payment failed, or account is on a plan type the payload does not report.
Common situations: Billing renewal failed, user cancelled subscription, new account with no plan, or Midjourney renaming plan fields so the check misreads an active account as inactive.
Related errors
- ${capabilities.plan || 'current'} plan does not support HD v
- No Midjourney generation credits remain for this billing per
- Could not click the ChatGPT ${target.label} model option.
- ${wantModel} model requires a paid Claude plan.
- --repeat must be a positive integer
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/6d6255ac27d01e3f.
Report an issue: GitHub.