FORTALMODEL & PRICING ADMIN
rev — 🧪 QA ← Studio
SELECT A MODEL

Loading model catalog…

Test in Studio ↗
LIVE CENTRALIZED PRICING PREVIEW

Customer-Group Quote Simulator (POST /v2/quote)

Test exact retail points across every customer tier using the saved catalog & FX settings. Customer price depends strictly on Base Tariff + Tier Margin + Sale—never backup vendor spikes.

1 · IDENTITY, MAKER PILL & GROUPING

4-Axis Model Taxonomy & Access Control

2 · AUTHORITATIVE PRICING & GUARDRAILS

Base Tariff (USD), Margin %, Variant Overrides & Promotions

price_version v1

📋 Live Price Sheet by Option Combination (USD Cost → Retail Points)

Auto-computed from your rate, margin %, variant overrides & FX—no manual token math needed (e.g. see exact 720p × 30s price immediately).

Variant Margin Overrides (Per-Option Margin % — e.g. resolution=4K, duration=30, 720p:30)

Match any option key=value, compound 720p:30, or shorthand 4K / high.

3 · ZERO-LITERAL VENDOR BINDINGS & FALLBACK

Secret Supplier Lanes (Priority #1 Primary → #2 Backup → #3 Rescue)

Every binding owns its own wire_model, upstream_endpoint, extra_headers, option_mapping, and capability limits. Changing a date suffix (e.g. …260928 → …261128) takes 2 seconds here—zero Go rebuilds. Leave Concurrency Cap blank for NULL (Unlimited) or set 0 to pause a lane.

4 · ADAPTIVE PROVIDER WAIT & POLLING STANDARD

Delivery Profile, Signed Webhooks & 3-Phase Poll Cadence

0 CRON DELAY
5 · CONFIG-DRIVEN VALIDATION & ATTACHMENTS

Prompt Limits, Attachment Slots (Platform Policy vs. Provider Hard Limit) & Modes

Dynamic Model Options & Validation Fields (100% DB/Catalog-Driven — Zero Code Impact)

Add, edit, or remove any option (e.g. resolution, duration, aspect_ratio, audio) right here; FE & Engine render and validate dynamically.

Attachment Slots (Edit Max Files, Max MB & Limit Origin Live)

Configured Task Modes (0)

Advanced: Inspect / Edit Full Model JSON (OptionsSchema, CrossRules, Modes)

Any edits in the visual fields above automatically merge with this model structure on Save, or click Apply Raw JSON to Form after editing complex nested schemas.

CONTROLLED TAXONOMY · ZERO FREE-TEXT DRIFT

Master Data Registry (Drives Model Dropdowns & Live FE Rendering)

LIVE CASCADE TO FE

Manage canonical dropdown values here so admins never create duplicate pills or broken task slugs. Renaming a Label updates all linked models immediately; items used by models cannot be deleted.

GLOBAL CURRENCY & POINT CONVERSION

USD → THB Exchange Rate & Safety Buffer

Effective Conversion Rate — THB / USD
TIER MARGIN HIERARCHY

Customer Pricing Groups

WORKSPACE TIERS & INTENTIONAL OVERDRAFT

Workspaces & Credit Wallets (Prepaid vs. Enterprise Postpaid)

MULTI-ACCOUNT RATE-LIMIT POOLING & VENDOR LANES

Add Multiple Accounts on the Same Provider (e.g. XSkill × 3 Accounts · LaoZhang VIP vs. Enterprise)

Pool multiple prepaid accounts under the same vendor (xskill-acct-1, xskill-acct-2, xskill-acct-3) for 3× RPM/concurrency, or scope keys to specific lanes (vip vs enterprise). On 401/402/429, the router rotates at most 1 sibling key; on 5xx/gateway down, it performs 0 key rotations so client latency is never wasted.

UNIFIED 41-TOOL REGISTRY

Creative Multi-Model Tools, Serverless Compute (FFmpeg FaaS) & Free Browser Tools

Serverless FaaS tools (video-clip-prep, final-cut-render, media-frame-gfx) support live Charging Enabled toggles: ship metered at 0.0 pts first, then turn billing ON in 1 click without deploying code.

SUPPLIER DRIFT & MARGIN PROTECTION

Margin Floor Monitor & 1-Click Tariff Auto-Patch

25 NOV INCIDENT LESSON · CURL-FIRST INTAKE

Paste Working Vendor Curl → Wire Diff

AUTO-FAILOVER & HALF-OPEN CANARY

Vendor Circuit Breakers & Outage Simulator

MINI-APP & AGENT CONTRACT GUARD · POST /v2/validate

Surface Bad-Param Rejections (HTTP 422)

Mini-apps can run POST /v2/validate in CI ($0, <0.1ms) before deploy. Any wrong param sent at runtime is blocked before debit and logged here by caller_surface.

SHARED FORTAL SUPABASE AUTH · ZERO PUBLIC SIGN-UP

Manual User & Role Provisioning + Mandatory 2FA (TOTP / AAL2)

Supabase Auth + AAL2

Users are created manually inside your shared Fortal Supabase Dashboard (Authentication → Users → Add User). Public registration is disabled. Every account must verify a 6-digit TOTP Authenticator code (aal2) before accessing either Studio Playground or Model & Pricing Admin.

Role 1: tester (QA Provider Tester — Studio Playground Only)

Can log into / (Studio Playground), select active models, upload test media, view retail customer points only, and test Mock or Live provider runs. Server redacts all USD COGS, margins, wire_model, and secret reseller names (xskill, laozhang), and blocks /admin with HTTP 403.

UPDATE auth.users
SET raw_app_meta_data = COALESCE(raw_app_meta_data, '{}'::jsonb)
  || '{"fortal_role": "tester", "workspace_id": "ws-pro"}'::jsonb
WHERE email = 'qa-tester@fortal.studio';

Role 2: super_admin / pricing_ops / model_ops (Admin + Full X-Ray)

Full access to /admin (93 models, base tariffs, live price sheets, customer group margins, sales, vendor bindings, encrypted key pools) plus the full 3-column Fortal X-Ray inspector on /.

UPDATE auth.users
SET raw_app_meta_data = COALESCE(raw_app_meta_data, '{}'::jsonb)
  || '{"fortal_admin_role": "super_admin", "workspace_id": "ws-b2b"}'::jsonb
WHERE email = 'owner@fortal.studio';

Production Environment Variables (Connect to Shared Fortal Supabase Auth)

FORTAL_ENV=production
FORTAL_SUPABASE_URL=https://<your-existing-fortal-project>.supabase.co
FORTAL_SUPABASE_ANON_KEY=<your-supabase-anon-key>
FORTAL_SUPABASE_JWT_SECRET=<your-supabase-jwt-secret>
FORTAL_KEY_RING_MASTER_KEY=<32-byte-hex-aes-256-gcm-key>