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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Claude2API</title>
    <style>
      :root {
        --bg: #0b0908;
        --bg-soft: #151210;
        --panel: rgba(24, 20, 18, 0.82);
        --panel-strong: rgba(34, 28, 25, 0.92);
        --line: rgba(241, 231, 220, 0.11);
        --line-strong: rgba(241, 231, 220, 0.2);
        --text: #f1e7dc;
        --muted: #b7a898;
        --accent: #e3c9a5;
        --accent-strong: #f3e0c4;
        --shadow: 0 28px 84px rgba(0, 0, 0, 0.42);
        --radius: 30px;
      }

      * {
        box-sizing: border-box;
      }

      html {
        color-scheme: dark;
      }

      body {
        margin: 0;
        min-height: 100vh;
        color: var(--text);
        font-family: "Helvetica Neue", "Segoe UI", ui-sans-serif, sans-serif;
        background:
          radial-gradient(circle at 14% 12%, rgba(227, 201, 165, 0.14), transparent 24%),
          radial-gradient(circle at 88% 10%, rgba(140, 98, 59, 0.18), transparent 18%),
          linear-gradient(180deg, #15110f 0%, var(--bg-soft) 38%, var(--bg) 100%);
      }

      body::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        opacity: 0.08;
        background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
        background-size: 100% 3px;
        mix-blend-mode: soft-light;
      }

      a {
        color: inherit;
        text-decoration: none;
      }

      code,
      pre {
        font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
      }

      h1,
      h2 {
        font-family: "Baskerville", "Times New Roman", Georgia, serif;
        letter-spacing: -0.04em;
      }

      .page {
        width: min(1080px, calc(100vw - 28px));
        margin: 0 auto;
        padding: 22px 0 34px;
      }

      .frame {
        position: relative;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: linear-gradient(180deg, rgba(35, 29, 25, 0.94), rgba(19, 16, 14, 0.93));
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
      }

      .frame::after {
        content: "";
        position: absolute;
        inset: auto -10% 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(243, 224, 196, 0.22), transparent);
      }

      .masthead {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
        gap: 22px;
        padding: 32px;
      }

      .tag {
        display: inline-flex;
        align-items: center;
        padding: 8px 14px;
        border-radius: 999px;
        border: 1px solid rgba(227, 201, 165, 0.16);
        background: rgba(227, 201, 165, 0.08);
        color: var(--accent);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
      }

      h1 {
        margin: 18px 0 12px;
        font-size: clamp(3rem, 8vw, 5.6rem);
        line-height: 0.92;
      }

      .lede {
        max-width: 680px;
        margin: 0;
        color: var(--muted);
        font-size: 1.03rem;
        line-height: 1.86;
      }

      .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 28px;
      }

      .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 150px;
        min-height: 46px;
        padding: 0 18px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        font-size: 14px;
        font-weight: 600;
        transition:
          transform 0.16s ease,
          border-color 0.16s ease,
          background 0.16s ease;
      }

      .button:hover {
        transform: translateY(-1px);
        border-color: var(--line-strong);
      }

      .button.primary {
        border-color: transparent;
        background: linear-gradient(135deg, var(--accent-strong), var(--accent));
        color: #1a140f;
      }

      .rail {
        display: grid;
        gap: 12px;
        align-content: start;
      }

      .glance {
        padding: 18px;
        border-radius: 22px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.03);
      }

      .glance span {
        display: block;
        margin-bottom: 8px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
      }

      .glance strong {
        display: block;
        font-size: 1rem;
        line-height: 1.65;
      }

      .content {
        display: grid;
        gap: 18px;
        margin-top: 18px;
      }

      .section {
        padding: 26px 28px;
      }

      .section-head {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 18px;
      }

      .section-head h2 {
        margin: 0;
        font-size: 2rem;
      }

      .section-head p,
      .note,
      .route p,
      .aside p {
        margin: 0;
        color: var(--muted);
        line-height: 1.78;
      }

      .routes {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 14px;
      }

      .route,
      .aside {
        padding: 18px;
        border-radius: 22px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.03);
      }

      .route h3 {
        margin: 0 0 10px;
        font-size: 1.06rem;
      }

      .route code,
      .aside code {
        color: var(--accent-strong);
      }

      .split {
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
        gap: 18px;
      }

      .code {
        margin: 0;
        padding: 18px;
        overflow: auto;
        border-radius: 22px;
        border: 1px solid var(--line);
        background: #0e0a08;
        color: #f6ecdf;
        line-height: 1.72;
      }

      .aside-stack {
        display: grid;
        gap: 14px;
      }

      .note {
        margin-top: 16px;
      }

      @media (max-width: 900px) {
        .masthead,
        .split {
          grid-template-columns: 1fr;
        }
      }

      @media (max-width: 720px) {
        .page {
          width: min(100vw - 18px, 1080px);
          padding-top: 14px;
        }

        .masthead,
        .section {
          padding: 22px;
        }

        h1 {
          font-size: clamp(2.6rem, 13vw, 4.2rem);
        }
      }
    </style>
  </head>
  <body>
    <main class="page">
      <section class="frame masthead">
        <div>
          <div class="tag">Hugging Face wrapper</div>
          <h1>Claude2API</h1>
          <p class="lede">
            Claude.ai sessions, surfaced as an Anthropic-compatible API. This root page exists to
            make the Space legible at first glance; the actual admin dashboard, health probe, and
            API behavior still come from the upstream <code>claude2api</code> runtime.
          </p>
          <div class="actions">
            <a class="button primary" href="/admin">Open Admin</a>
            <a class="button" href="/health">Health</a>
          </div>
        </div>

        <aside class="rail">
          <div class="glance">
            <span>Root</span>
            <strong>Static landing page served by the wrapper.</strong>
          </div>
          <div class="glance">
            <span>Runtime</span>
            <strong>All non-root routes pass through to the upstream service.</strong>
          </div>
          <div class="glance">
            <span>Access</span>
            <strong>Private Space auth and app-level API keys can both apply.</strong>
          </div>
        </aside>
      </section>

      <div class="content">
        <section class="frame section">
          <div class="section-head">
            <div>
              <h2>Where to go</h2>
            </div>
            <p>
              The wrapper fixes the root experience only. It does not replace upstream routing,
              persistence, or configuration semantics.
            </p>
          </div>

          <div class="routes">
            <article class="route">
              <h3><code>/admin</code></h3>
              <p>Upstream dashboard for accounts, model mapping, proxy settings, and API key changes.</p>
            </article>
            <article class="route">
              <h3><code>/health</code></h3>
              <p>Direct passthrough to the upstream health endpoint, kept simple for probes and checks.</p>
            </article>
            <article class="route">
              <h3><code>/v1/messages</code></h3>
              <p>Anthropic-compatible request path. Auth and streaming semantics remain upstream-defined.</p>
            </article>
          </div>
        </section>

        <section class="frame section">
          <div class="section-head">
            <div>
              <h2>Quick request</h2>
            </div>
            <p>
              Use the Space URL as the base URL. If the Space is private, Hugging Face must allow the
              request before the app can evaluate its own token checks.
            </p>
          </div>

          <div class="split">
            <pre class="code"><code>curl https://YOUR-SPACE.hf.space/v1/messages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CLAUDE_API_KEY" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 128,
    "messages": [
      {"role": "user", "content": "hello"}
    ]
  }'</code></pre>

            <div class="aside-stack">
              <div class="aside">
                <p>
                  Runtime edits made in <code>/admin</code> do not mean Hugging Face Secrets were
                  updated. Treat wrapper config, Secrets, and any upstream persistence layer as
                  separate concerns.
                </p>
              </div>
              <div class="aside">
                <p>
                  This page intentionally avoids live status, mutable controls, and any secret-derived
                  values. It is an entrance, not a console.
                </p>
              </div>
            </div>
          </div>

          <p class="note">
            For stable persisted settings after restart, rely on upstream-supported storage and verify
            the behavior explicitly instead of assuming the wrapper can override startup precedence.
          </p>
        </section>
      </div>
    </main>
  </body>
</html>