// ───────────────────────────────────────── // Hidrogen App — root with auth + data boot // ───────────────────────────────────────── const { useState: uS, useEffect: uE } = React; const HDR = window.HDR_DATA; const API = window.HDR_API; const C = window.HDR_CONSTANTS; const U = window.HDR_UTIL; function App() { const [me, setMe] = uS(null); const [loading, setLoading] = uS(true); const [mode, setMode] = uS(() => localStorage.getItem('hdr.mode') || 'user'); const [route, setRoute] = uS(() => localStorage.getItem('hdr.route') || 'overview'); const [theme, setTheme] = uS(() => localStorage.getItem('hdr.theme') || 'dark'); const [accent, setAccent] = uS(() => localStorage.getItem('hdr.accent') || 'saffron'); const [density, setDensity]=uS(() => localStorage.getItem('hdr.density') || 'comfortable'); const [showTweaks, setShowTweaks] = uS(false); // Load user + initial data uE(() => { (async () => { try { const user = await API.me(); setMe(user); // Force user mode if not admin if (!user.is_admin && localStorage.getItem('hdr.mode') === 'admin') { setMode('user'); localStorage.setItem('hdr.mode', 'user'); } window.HDR_USER = user; } catch (e) { if (e.message !== 'unauthorized') console.error(e); } finally { setLoading(false); } })(); }, []); uE(() => { document.documentElement.setAttribute('data-theme', theme); localStorage.setItem('hdr.theme', theme); }, [theme]); uE(() => { document.documentElement.setAttribute('data-density', density); localStorage.setItem('hdr.density', density); }, [density]); uE(() => { localStorage.setItem('hdr.mode', mode); localStorage.setItem('hdr.route', route); }, [mode, route]); uE(() => { const map = { saffron: { h: '62', c: '0.16' }, indigo: { h: '265', c: '0.15' }, emerald: { h: '155', c: '0.14' }, coral: { h: '30', c: '0.16' }, }; const v = map[accent] || map.saffron; document.documentElement.style.setProperty('--accent', `oklch(0.745 ${v.c} ${v.h})`); document.documentElement.style.setProperty('--accent-soft', `oklch(0.745 ${v.c} ${v.h} / 0.14)`); document.documentElement.style.setProperty('--accent-line', `oklch(0.745 ${v.c} ${v.h} / 0.32)`); localStorage.setItem('hdr.accent', accent); }, [accent]); if (loading) { return (
H
Loading Hidrogen…
); } if (!me) { return location.reload()} />; } const userScreens = { overview: , playground: , agents: , skills: , keys: , billing: , logs: , docs: , }; const adminScreens = { overview: , analytics: , users: , alllogs: , models: , skills: , tools: , settings: , }; const screen = (mode === 'admin' ? adminScreens : userScreens)[route] || ; return (
{screen}
{showTweaks && ( setShowTweaks(false)} /> )}
); } // ───────────────────────────────────────── // Auth screen (login + signup combined) // ───────────────────────────────────────── function AuthScreen({ onAuth }) { const [tab, setTab] = uS('login'); const [email, setEmail] = uS(''); const [pwd, setPwd] = uS(''); const [name, setName] = uS(''); const [busy, setBusy] = uS(false); const [err, setErr] = uS(''); const [legalDoc, setLegalDoc] = uS(null); // 'tc' | 'privacy' | 'refund' | null const [agree, setAgree] = uS(false); const submit = async (e) => { e?.preventDefault(); if (busy) return; if (tab === 'signup' && !agree) { setErr('Please accept the Terms & Privacy Policy'); return; } setBusy(true); setErr(''); try { const fn = tab === 'login' ? API.login : API.signup; const r = await fn({ email, password: pwd, ...(tab === 'signup' ? { name } : {}) }); if (r.error) throw new Error(r.error.message || r.error); if (r.id || r.ok) onAuth(); else throw new Error('Auth failed'); } catch (e) { setErr(e.message || 'Failed'); } finally { setBusy(false); } }; return (
H
Hidrogen.in
v2.4 · ap-south-1

India's smartest AI API.
One key, every task.

Built in India, for India. Hidrogen routes every request through the right model automatically — chat, voice, images, Indian languages — with INR billing and zero vendor lock-in.

{/* Hidrogen model aliases — NOT provider names */}
Hidrogen Models
{[ { alias: 'smart', tag: 'Default' }, { alias: 'smart-pro', tag: 'Pro reasoning' }, { alias: 'fast', tag: 'Lowest latency' }, { alias: 'creative', tag: 'Long-form' }, { alias: 'image', tag: 'Visual' }, { alias: 'voice', tag: 'TTS' }, { alias: 'stt-in', tag: 'Indian STT' }, ].map(m => (
{m.alias} · {m.tag}
))}
{/* Trust strip */}
INR billing · GST invoice
99.9% uptime · ap-south-1
Smart fallback · No vendor lock-in
© Hidrogen, Lucknow

{tab === 'login' ? 'Welcome back' : 'Create your account'}

{tab === 'login' ? 'Sign in to your dashboard.' : 'Free ₹50 credits on signup, no card needed.'}

{tab === 'signup' && (
Name
setName(e.target.value)} autoFocus/>
)}
Email
setEmail(e.target.value)} autoFocus={tab==='login'} required/>
Password
setPwd(e.target.value)} required minLength={6}/>
{err &&
{err}
} {tab === 'signup' && ( )}
{/* Legal document modal */} setLegalDoc(null)}/>
); } // ───────── Legal documents modal (T&C, Privacy, Refund) ───────── function LegalModal({ doc, onClose }) { if (!doc) return null; const docs = { tc: { title: 'Terms & Conditions', subtitle: 'Last updated: ' + new Date().toLocaleDateString('en-IN', { day: 'numeric', month: 'long', year: 'numeric' }), content: ( <>

1. Acceptance of Terms

By accessing or using the Hidrogen API platform ("Service"), provided by Hidrogen, Lucknow, India ("Hidrogen", "we", "us", "our"), you ("User", "you", "your") agree to be bound by these Terms & Conditions. If you do not agree, do not use the Service.

2. The Service

Hidrogen provides a unified API gateway for AI services (chat, image, voice, speech-to-text). The Service routes requests intelligently across underlying AI infrastructure, bills in INR, and is intended primarily for Indian developers and businesses.

3. Account & Eligibility

You must be at least 18 years old and capable of forming a legally binding contract under the Indian Contract Act, 1872. You are responsible for keeping your account credentials and API keys secure. Any activity through your account is your responsibility.

4. Acceptable Use

You agree NOT to use the Service to:

  • Generate, distribute, or facilitate illegal content, hate speech, harassment, or content harming minors
  • Reverse-engineer, scrape, or circumvent the API or rate limits
  • Resell raw API access without adding substantial value
  • Violate any applicable Indian law including the IT Act 2000 and its rules
  • Build applications that mislead users about being human (without disclosure)

5. Billing & Payments

All charges are in Indian Rupees (INR). You pre-fund your wallet via Razorpay (UPI, cards, net-banking) or set up Auto-Pay for recurring monthly recharges. API usage is metered per request and deducted from your wallet balance. Pricing is published in the dashboard and may change with 30 days' notice.

Auto-Pay: If you enable Auto-Pay, you authorize Razorpay to charge your selected payment instrument every month for the configured amount until you pause or cancel the mandate from your bank/UPI app or Hidrogen dashboard.

6. API Keys & Security

API keys (prefix hi_) are sensitive credentials. Never commit them to version control, share publicly, or expose them client-side. Compromised keys must be revoked immediately. Hidrogen is not liable for unauthorized usage resulting from your key disclosure.

7. Service Availability

We target 99.9% uptime but do not guarantee uninterrupted service. Maintenance windows, third-party provider outages, and force-majeure events may cause temporary unavailability. No service credits are issued unless explicitly mentioned in a separate SLA agreement.

8. Intellectual Property

The Hidrogen platform, branding, and documentation are owned by Hidrogen. You retain ownership of your prompts and the outputs you generate (subject to applicable law on AI-generated content). You grant Hidrogen a limited license to process your inputs solely to deliver the Service.

9. Privacy

Your data is handled per our Privacy Policy. We do not train models on your data.

10. Limitation of Liability

To the maximum extent permitted by law, Hidrogen's total aggregate liability for any claims relating to the Service shall not exceed the amount paid by you to Hidrogen in the three (3) months preceding the claim. We are not liable for indirect, incidental, consequential, or punitive damages.

11. Termination

You may close your account anytime. We may suspend or terminate access for violations of these Terms, prolonged inactivity (12+ months), or if required by law. Unused wallet balance may be refunded per the Refund Policy on closure.

12. Governing Law & Jurisdiction

These Terms are governed by the laws of India. Any disputes shall be subject to the exclusive jurisdiction of courts at Lucknow, Uttar Pradesh.

13. Changes

We may update these Terms; continued use after updates means acceptance. Material changes will be notified by email.

14. Contact

Hidrogen, Lucknow, Uttar Pradesh, India · hello@hidrogen.in

) }, privacy: { title: 'Privacy Policy', subtitle: 'Last updated: ' + new Date().toLocaleDateString('en-IN', { day: 'numeric', month: 'long', year: 'numeric' }), content: ( <>

1. Who We Are

Hidrogen is operated by Hidrogen, based in Lucknow, Uttar Pradesh, India. This Privacy Policy describes how we collect, use, and protect your information.

2. Information We Collect

Account information: Name, email, password (hashed), phone (optional).

Payment information: Processed entirely by Razorpay. We store transaction IDs and amounts but never see or store your card numbers, UPI PINs, or bank credentials.

Usage data: API request metadata (endpoint, model alias, latency, token counts, status codes). We do NOT log the content of your prompts or model responses in plain text by default.

Technical data: IP address, user agent, timestamps — used for security and rate limiting.

3. How We Use Your Information

  • To operate the Service and process API requests
  • To bill you accurately and prevent fraud
  • To send transactional emails (receipts, security alerts, important updates)
  • To respond to support queries
  • To comply with legal obligations under Indian law

4. We Do NOT

  • Train AI models on your prompts or outputs
  • Sell your data to third parties
  • Send unsolicited marketing without your consent
  • Share data with underlying AI providers beyond what is needed to fulfill your request (and even then, anonymized where possible)

5. Third-Party Processors

We use the following processors strictly to deliver the Service:

  • Razorpay — payments (PCI-DSS Level 1 certified)
  • Hostinger — application hosting (ap-south-1, Mumbai region)
  • Underlying AI inference providers — solely for processing your requests, not data analytics

6. Data Storage & Security

Data is stored in India (Mumbai, ap-south-1). We use industry-standard encryption (TLS in transit, hashed credentials at rest). Despite our efforts, no system is 100% secure — please use strong passwords and rotate API keys regularly.

7. Data Retention

Account data is retained while your account is active and for 12 months after closure (for audit/tax compliance). Usage logs are retained for 90 days. You can request earlier deletion by emailing us, subject to legal retention requirements.

8. Your Rights (DPDP Act 2023)

Under the Digital Personal Data Protection Act, 2023, you have the right to:

  • Access the personal data we hold about you
  • Correct inaccurate information
  • Request erasure (subject to legal retention requirements)
  • Withdraw consent for processing
  • File a grievance — contact privacy@hidrogen.in

9. Cookies

We use only essential cookies (session JWT for authentication). No tracking, advertising, or third-party analytics cookies.

10. Children's Privacy

Hidrogen is not directed at children under 18. We do not knowingly collect data from minors.

11. Changes to This Policy

We will notify users by email of material changes. Continued use after updates means acceptance.

12. Grievance Officer

Per Indian IT Rules, our designated Grievance Officer is reachable at: grievance@hidrogen.in · Hidrogen, Lucknow, Uttar Pradesh, India. Response within 30 days.

) }, refund: { title: 'Refund & Cancellation Policy', subtitle: 'Last updated: ' + new Date().toLocaleDateString('en-IN', { day: 'numeric', month: 'long', year: 'numeric' }), content: ( <>

1. Wallet Recharges

Hidrogen wallet recharges (one-time or via Auto-Pay) are non-refundable once credited, except in the following cases:

  • Duplicate payment due to technical error (full refund within 7 working days)
  • Wallet credited but service unavailable for >48 consecutive hours (pro-rata refund of unused balance)
  • Account closure within 7 days of first recharge with no API usage (full refund minus payment gateway charges)

2. API Usage

API charges are metered per successful request and deducted from your wallet at the time of use. Once a request is successfully processed, the deduction is final. Failed requests (HTTP 5xx errors caused by Hidrogen) are not billed; failed requests due to client errors (4xx) may or may not be billed depending on whether work was performed.

3. Auto-Pay Cancellation

You may pause or cancel Auto-Pay anytime from:

  • The Hidrogen Billing dashboard (Pause button)
  • Your bank app or UPI app where you authorized the mandate (full revocation)

Cancellation stops future charges but does not refund prior cycles.

4. How to Request a Refund

Email billing@hidrogen.in within 14 days of the disputed charge with:

  • Your account email
  • Razorpay payment ID
  • Reason for refund request

We respond within 3 working days. Approved refunds are processed via Razorpay to the original payment method within 5-7 working days.

5. Chargebacks

If you initiate a chargeback without first contacting us, we reserve the right to suspend your account pending resolution.

) } }; const d = docs[doc] || docs.tc; return (
e.stopPropagation()} style={{ background: 'var(--surface)', borderRadius: 'var(--r-xl)', maxWidth: 760, width: '100%', maxHeight: '88vh', display: 'flex', flexDirection: 'column', border: '1px solid var(--border)', boxShadow: '0 24px 60px rgba(0,0,0,0.3)', }}>

{d.title}

{d.subtitle}
{d.content}
); } function Tweaks({ theme, setTheme, accent, setAccent, density, setDensity, onClose }) { const accents = [ { id: 'saffron', color: 'oklch(0.745 0.16 62)' }, { id: 'indigo', color: 'oklch(0.745 0.15 265)' }, { id: 'emerald', color: 'oklch(0.745 0.14 155)' }, { id: 'coral', color: 'oklch(0.745 0.16 30)' }, ]; return (

Tweaks

Theme
Accent
{accents.map(a => (
setAccent(a.id)}/> ))}
Density
); } function pickColor(seed) { const colors = ['#4285F4','#10A37F','#D97757','#8E44EC','#E91E63','#FF9800','#00BCD4','#795548']; let h = 0; for (let i = 0; i < (seed||'').length; i++) h = (h * 31 + seed.charCodeAt(i)) & 0xff; return colors[h % colors.length]; } window.pickColor = pickColor; ReactDOM.createRoot(document.getElementById('root')).render();