'empty' ]; if ( ! empty( $chk['error'] ) ) { echo '

Site Key Error: ' . esc_html( (string)$chk['error'] ) . '

'; unset( $opt['site_token'] ); } else { $opt['site_token'] = $new; echo '

Site Key saved. Pro mode activated!

'; } update_option( 'aatb_settings', $opt ); $token = $opt['site_token'] ?? ''; $mode = function_exists( 'aatb_active_mode' ) ? aatb_active_mode() : 'none'; } /* Alt-Text settings (model + language + custom prompt + auto_generate) */ if ( $action === 'aatb_save_alt_settings' ) { $allowed = ['gpt-4.1-mini','gpt-4o','gpt-4.1']; $chosen = sanitize_text_field( wp_unslash( $_POST['model_choice'] ?? 'gpt-4.1-mini' ) ); $opt['model_choice'] = in_array( $chosen, $allowed, true ) ? $chosen : 'gpt-4.1-mini'; $sel = sanitize_text_field( wp_unslash( $_POST['lang_choice'] ?? 'en' ) ); $opt['lang_choice'] = ( $sel === 'other' ) ? sanitize_text_field( wp_unslash( $_POST['lang_custom'] ?? 'en' ) ) : $sel; $cp = sanitize_textarea_field( wp_unslash( $_POST['custom_prompt'] ?? '' ) ); if ( mb_strlen( $cp ) > 1500 ) { $cp = mb_substr( $cp, 0, 1500 ); } $opt['custom_prompt'] = $cp; $opt['auto_generate'] = ! empty( $_POST['auto_generate'] ) ? '1' : ''; update_option( 'aatb_settings', $opt ); $model = $opt['model_choice']; $lang = $opt['lang_choice']; echo '

Settings saved.

'; } } /* ───────────── PRO MODE: TOKEN / USAGE NORMALIZATION ───────────── */ $usage=$limit=$remain=$site_usage=null; $membership='free'; $allowed_models_ui = ['gpt-4.1-mini','gpt-4o','gpt-4.1']; if ( $token && $mode === 'pro' ) { $st = aatb_check_token_status( $token ); if ( empty( $st['error'] ) ) { $site_usage = (int)($st['site_usage'] ?? 0); $limit = (int)( $st['plan_limit_total'] ?? $st['plan_limit'] ?? $st['token_limit'] ?? 0 ); $usage_total = null; foreach ( ['usage_total','all_usage','total_usage','token_usage','usage'] as $k ) { if ( isset($st[$k]) ) { $usage_total = (int)$st[$k]; break; } } if ( $usage_total === null ) { $usage_total = max(0, (int)$site_usage); } $remain = aatb_status_remaining( $st ); $usage = (int)$usage_total; $membership = strtolower( trim( $st['membership'] ?? 'free' ) ); if ( ! empty( $st['allowed_models'] ) && is_array( $st['allowed_models'] ) ) { $allowed_models_ui = array_values( array_intersect( $allowed_models_ui, $st['allowed_models'] ) ); if ( empty($allowed_models_ui) ) { $allowed_models_ui = ['gpt-4.1-mini']; } } } $canonical = ['gpt-4.1-mini','gpt-4o','gpt-4.1']; $gate = [ 'free' => ['gpt-4.1-mini'], 'starter' => ['gpt-4.1-mini','gpt-4.1'], 'creator' => ['gpt-4.1-mini','gpt-4.1','gpt-4o'], 'expert' => ['gpt-4.1-mini','gpt-4.1','gpt-4o'], ]; if ( isset($gate[$membership]) ) { $allowed_models_ui = array_values( array_intersect($canonical, $gate[$membership]) ); } if ( ! in_array($model, $allowed_models_ui, true) ) { $model = 'gpt-4.1-mini'; $opt['model_choice'] = $model; update_option('aatb_settings', $opt); } } $trial_remaining = (int) ( $opt['trial_remaining'] ?? 0 ); $byok_key_masked = ''; if ( ! empty( $opt['openai_key'] ) ) { $k = $opt['openai_key']; $byok_key_masked = substr( $k, 0, 7 ) . str_repeat( '*', max( 0, strlen($k) - 11 ) ) . substr( $k, -4 ); } $is_pro = $mode === 'pro'; ?>
AI Alt Text Builder

AI Alt Text Builder

Media Library ALT Text Generator

MODE v

Getting Started

Choose how you want to generate alt text for your images.

FREE

Free Trial

Start instantly with 25 free alt text generations. No API key needed.

  • 25 lifetime tokens
  • GPT-4.1 Mini model
  • English only
  • Single image generation
  • SEO score badge

No credit card required

UNLIMITED

Your Own API Key

Use your own OpenAI API key. You pay OpenAI directly, we don't touch your key.

  • Unlimited generations
  • GPT-4.1 Mini model
  • English only
  • Single image generation
  • No SEO score badge

Your key stays on your server

PRO

RankPilotAI Pro

Full power with zero API hassle. We handle everything, just use your tokens.

  • No API key needed
  • Bulk generation
  • Auto-generate on upload
  • All models (Mini/4.1/4o)
  • All languages
  • Custom prompt
  • SEO score badge

Get a Site Key

Free Trial Active

of 25 tokens remaining

/ 25

Your trial tokens are used up. Choose one of these options to continue:

Upgrade to Pro

OpenAI API Key Active

Unlimited single image generations

Pro Mode Active

Full access to all features

Connected
Website
Used
Limit
Remaining
% used

Alt-Text Settings

Configure how AI generates alt text for your images.

AI Model

Mini only

Alt-Text Language

English only

Select "Other / Custom" and type the language exactly as you'd like it.

English All languages with Pro

Custom Prompt

PRO

Optional. Add brand or style guidance. Your note is appended to the built-in instructions and takes priority over general rules; the 125-character limit always applies.

Add custom brand or style guidance to your alt text generations.

Available with Pro

Auto-Generate on Upload

PRO

Automatically generate alt text every time you upload an image.

Available with Pro

Feature Comparison

See what's available in each mode.

Feature Free Trial Own API Key Pro
No API Key Needed ✓ ✕ Your OpenAI key ✓ We handle it
Single Image Generate ✓ ✓ ✓
Bulk Generation ✕ ✕ ✓
Auto-Generate on Upload ✕ ✕ ✓
SEO Score Badge ✓ ✓ ✓
Languages English English All languages
AI Models Mini Mini Mini / 4.1 / 4o
Custom Prompt ✕ ✕ ✓
Generations 25 lifetime Unlimited Plan-based