| <!DOCTYPE html>
|
| <html lang="zh-CN">
|
| <head>
|
|
|
|
|
| <script>
|
|
|
| (function () {
|
| var KEY = "g2a_asset_reload_at";
|
| function reloadedRecently() {
|
| try { return (Date.now() - Number(sessionStorage.getItem(KEY) || 0)) < 60000; } catch (e) { return false; }
|
| }
|
| function markReload() {
|
| try { sessionStorage.setItem(KEY, String(Date.now())); } catch (e) {}
|
| }
|
| window.__g2aScriptFailed = function (el) {
|
| console.error("static script failed", el && el.src);
|
| if (!reloadedRecently()) {
|
| markReload();
|
| var u = new URL(location.href);
|
| u.searchParams.set("_g2a_cb", String(Date.now()));
|
| location.replace(u.pathname + u.search);
|
| return;
|
| }
|
| var d = document.getElementById("boot-desc") || document.getElementById("boot-hint");
|
| if (d) d.textContent = "静态资源加载失败,请点击重试";
|
| };
|
| window.__g2aBootLogin = function () {
|
| function show(msg) {
|
| try {
|
| var boot = document.getElementById("boot-view");
|
| var auth = document.getElementById("auth-view");
|
| if (boot) boot.classList.remove("hidden");
|
| if (auth) auth.classList.add("hidden");
|
| var d = document.getElementById("boot-desc");
|
| var h = document.getElementById("boot-hint");
|
| if (d) d.textContent = "页面脚本未就绪";
|
| if (h) h.innerHTML = (msg || "") +
|
| '<br><button type="button" class="g2a-btn g2a-btn-primary" style="margin-top:12px" id="g2a-reload-btn">重试</button>';
|
| var b = document.getElementById("g2a-reload-btn");
|
| if (b) b.onclick = function () {
|
| try { sessionStorage.removeItem(KEY); } catch (e) {}
|
| location.replace(location.pathname + "?_g2a_cb=" + Date.now());
|
| };
|
| } catch (e) {}
|
| }
|
|
|
| var tries = 0;
|
| function attempt() {
|
| tries += 1;
|
| if (window.G2A && typeof G2A.api === "function" && G2A.auth && typeof G2A.auth.initLoginPage === "function") {
|
| try { G2A.auth.initLoginPage(); } catch (e) { show(String(e && e.message || e)); }
|
| return;
|
| }
|
| if (tries < 20) { setTimeout(attempt, 50); return; }
|
| show("登录脚本加载不完整。点击重试。");
|
| }
|
| attempt();
|
| };
|
| })();
|
| </script>
|
|
|
|
|
|
|
| <script>
|
|
|
| (function () {
|
| try {
|
| var t = localStorage.getItem("g2a_theme");
|
| if (t !== "light" && t !== "dark") {
|
| t = (window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches) ? "light" : "dark";
|
| }
|
| document.documentElement.setAttribute("data-theme", t);
|
| document.documentElement.style.colorScheme = t;
|
| document.documentElement.style.background = t === "light" ? "#f5f7fb" : "#0a0a0f";
|
| var tok = localStorage.getItem("g2a_admin_token") || "";
|
| var ts = Number(localStorage.getItem("g2a_admin_token_ts") || 0) || 0;
|
| var grace = tok && ts && (Date.now() - ts) < 7 * 24 * 3600 * 1000;
|
| if (tok || grace) document.documentElement.classList.add("g2a-has-session");
|
| } catch (e) {}
|
|
|
| window.addEventListener("pageshow", function () {
|
| try { document.body && document.body.classList.remove("g2a-softnav-busy"); } catch (_) {}
|
| });
|
|
|
| setTimeout(function () {
|
| try { document.body && document.body.classList.remove("g2a-softnav-busy"); } catch (_) {}
|
| }, 12000);
|
| })();
|
| </script>
|
|
|
|
|
| <meta charset="utf-8" />
|
| <meta name="viewport" content="width=device-width, initial-scale=1" />
|
| <title>接入指南 · grokcli-2api</title>
|
| <link rel="preconnect" href="https://fonts.googleapis.com" />
|
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
|
| <link rel="stylesheet" href="/static/dist/admin-antd.1031c5bb2f.css" />
|
| <link rel="icon" href="/static/favicon.ico" type="image/x-icon" />
|
|
|
| </head>
|
| <body class="g2a-body" data-page="guide">
|
| <div id="toast" class="g2a-message"></div>
|
| <div class="g2a-layout" id="main-view">
|
| <aside class="g2a-sider">
|
| <div class="g2a-brand">
|
| <div class="g2a-logo">G</div>
|
| <div>
|
| <div class="g2a-brand-title">grokcli-2api</div>
|
| <div class="g2a-brand-sub"><span id="app-version">…</span> · Admin</div>
|
| </div>
|
| </div>
|
| <nav class="g2a-menu">
|
| <a class="g2a-menu-item " href="/admin" data-page="overview"><span class="g2a-menu-ico">◫</span><span>概览</span></a>
|
| <a class="g2a-menu-item " href="/admin/keys" data-page="keys"><span class="g2a-menu-ico">🔑</span><span>API Keys</span></a>
|
| <a class="g2a-menu-item " href="/admin/accounts" data-page="accounts"><span class="g2a-menu-ico">👥</span><span>账号 / 轮询</span></a>
|
| <a class="g2a-menu-item " href="/admin/usage" data-page="usage"><span class="g2a-menu-ico">Σ</span><span>用量</span></a>
|
| <a class="g2a-menu-item " href="/admin/logs" data-page="logs"><span class="g2a-menu-ico">📜</span><span>任务日志</span></a>
|
| <a class="g2a-menu-item " href="/admin/models" data-page="models"><span class="g2a-menu-ico">▣</span><span>模型</span></a>
|
| <a class="g2a-menu-item " href="/admin/settings" data-page="settings"><span class="g2a-menu-ico">⚙</span><span>系统设置</span></a>
|
| <a class="g2a-menu-item is-active" href="/admin/guide" data-page="guide"><span class="g2a-menu-ico">📘</span><span>接入指南</span></a>
|
| </nav>
|
| <div class="g2a-sider-foot">
|
| <a href="/docs" target="_blank" rel="noopener">Swagger</a>
|
| <a href="/health" target="_blank" rel="noopener">Health</a>
|
| <a href="/metrics" target="_blank" rel="noopener">Metrics</a>
|
| <button type="button" class="g2a-btn g2a-btn-default g2a-btn-block" id="btn-logout">退出登录</button>
|
| </div>
|
| </aside>
|
| <div class="g2a-main">
|
| <header class="g2a-header">
|
| <div>
|
| <h1 id="page-title">接入指南</h1>
|
| <p id="page-sub">OpenAI / Anthropic 客户端配置示例</p>
|
| </div>
|
| <div class="g2a-header-actions">
|
| <span id="status-pill" class="g2a-tag">—</span>
|
| <button type="button" class="g2a-theme-toggle" data-theme-toggle aria-label="切换主题"><span class="ico">☀️</span><span class="label">白天</span></button>
|
| <button type="button" class="g2a-btn g2a-btn-default" id="btn-refresh">刷新</button>
|
| </div>
|
| </header>
|
| <div class="g2a-mobile-nav" id="mobile-nav"></div>
|
| <div class="g2a-content">
|
|
|
| <section class="g2a-card">
|
| <div class="g2a-card-head">
|
| <div>
|
| <h3>接入信息</h3>
|
| <p>Base URL 与默认模型(优先使用当前浏览器 origin)。</p>
|
| </div>
|
| </div>
|
| <div class="g2a-kv"><span>OpenAI Base</span><code id="guide-base" class="g2a-code-inline">—</code></div>
|
| <div class="g2a-kv"><span>默认模型</span><code id="guide-model" class="g2a-code-inline">—</code></div>
|
| </section>
|
|
|
| <section class="g2a-card">
|
| <div class="g2a-card-head"><div><h3>cURL</h3><p>快速测通。</p></div></div>
|
| <pre id="guide-curl" class="g2a-code">—</pre>
|
| </section>
|
| <section class="g2a-card">
|
| <div class="g2a-card-head"><div><h3>OpenAI Python</h3></div></div>
|
| <pre id="guide-py" class="g2a-code">—</pre>
|
| </section>
|
| <section class="g2a-card">
|
| <div class="g2a-card-head"><div><h3>Anthropic Python</h3></div></div>
|
| <pre id="guide-anthropic" class="g2a-code">—</pre>
|
| </section>
|
| <section class="g2a-card">
|
| <div class="g2a-card-head"><div><h3>Linux 部署提示</h3></div></div>
|
| <pre id="guide-linux" class="g2a-code">—</pre>
|
| </section>
|
|
|
| </div>
|
| </div>
|
| </div>
|
| <script src="/static/dist/utils.360f09cd20.js" onerror="window.__g2aScriptFailed&&__g2aScriptFailed(this)"></script>
|
| <script src="/static/dist/api.c4edde3d16.js" onerror="window.__g2aScriptFailed&&__g2aScriptFailed(this)"></script>
|
| <script src="/static/dist/state.da9974e23b.js" onerror="window.__g2aScriptFailed&&__g2aScriptFailed(this)"></script>
|
| <script src="/static/dist/auth.fa7b1e0e4d.js" onerror="window.__g2aScriptFailed&&__g2aScriptFailed(this)"></script>
|
| <script src="/static/dist/core.63c43151f2.js" onerror="window.__g2aScriptFailed&&__g2aScriptFailed(this)"></script>
|
| </body>
|
| </html>
|
|
|