From 63b108704279f0c1f5cf73a2eeab30fc61c3d6c0 Mon Sep 17 00:00:00 2001 From: artheru Date: Wed, 10 Jun 2026 14:16:26 +0800 Subject: [PATCH] account: show a runnable curl when you mint a key (0.94.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit minting an agent key showed the key once with no hint of what to do with it — you had to go dig through the docs to make your first call. great API products hand you a working example right there. - after minting, show a ready-to-run curl with YOUR key inlined, hitting a real read-only endpoint (GET /agents/classes), plus a one-click copy and a link to the API reference - completes the get-key -> call-the-API loop and reinforces the agent-native pitch - verified live (throwaway account, cleaned up after): the curl renders with the real minted key, copy button + api-reference link present --- index.html | 2 +- package.json | 2 +- src/AgentPlatform.jsx | 13 ++++++++++++- src/Scene2D.jsx | 2 +- src/styles.css | 7 +++++++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 37a5d21..6474e38 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ @media (prefers-reduced-motion: reduce) { .app-loading-gem { animation: none; transform: rotate(45deg); } } - + diff --git a/package.json b/package.json index e62a6af..4bc4dc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amerc-site", - "version": "0.93.0-docsearch", + "version": "0.94.0-keytry", "private": true, "type": "module", "scripts": { diff --git a/src/AgentPlatform.jsx b/src/AgentPlatform.jsx index 9488232..81b95db 100644 --- a/src/AgentPlatform.jsx +++ b/src/AgentPlatform.jsx @@ -242,7 +242,18 @@ export function KeysCard() { setName(e.target.value)} required /> - {created &&

✅ minted — copy now, shown once:

copyToast(created.key)}>{created.key} ⧉
} + {created && ( +
+

✅ minted — copy now, shown once:

+ copyToast(created.key)}>{created.key} ⧉ +

Try it — your key drives the whole API:

+
+ {`curl -H "Authorization: Bearer ${created.key}" https://amerc.ai/api/agents/classes`} + +
+

Full endpoints in the API reference.

+
+ )} {err &&

{err}

} {keys.map((k) => (
diff --git a/src/Scene2D.jsx b/src/Scene2D.jsx index c81b4f7..1d2492b 100644 --- a/src/Scene2D.jsx +++ b/src/Scene2D.jsx @@ -10,7 +10,7 @@ import { api } from './api.js'; const Menu = ({ size = 20 }) => (); const X = ({ size = 20 }) => (); -const RELEASE = '0.93.0-docsearch'; +const RELEASE = '0.94.0-keytry'; const NAV = [ { id: 'home', label: 'Tavern' }, diff --git a/src/styles.css b/src/styles.css index ef22f37..2ea14a1 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1547,3 +1547,10 @@ button { .docs-result-title { color: #eaf2ff; font-size: 13.5px; font-weight: 600; } .docs-result-snip { color: #8595ab; font-size: 12px; line-height: 1.45; } .docs-result-snip mark { background: rgba(39, 216, 255, 0.22); color: #d6f0f8; border-radius: 2px; padding: 0 1px; } + +/* key-minting "try it" curl example (0.94) */ +.ap-keys-try { margin: 13px 0 5px; color: #b6a7d4; font-size: 12.5px; } +.ap-keys-curl { display: flex; align-items: center; gap: 8px; background: #0a0e16; border: 1px solid #20384a; border-radius: 9px; padding: 9px 11px; } +.ap-keys-curl code { flex: 1; min-width: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: #cfe2f2; overflow-x: auto; white-space: nowrap; } +.ap-keys-copy { flex: 0 0 auto; background: #46c8e0; color: #07111a; border: none; border-radius: 6px; padding: 5px 11px; font-size: 11px; font-weight: 600; cursor: pointer; } +.ap-keys-copy:hover { background: #6ad6ea; }