api-tokens
Route The pieces that are a whole response rather than a piece of one.
The API token page: the one-time reveal, the create form, the list and the revoke buttons.
Each example is live, but its links go nowhere. HTML shows the markup to copy.
Four tokens, two of them live
The revoke forms post to /tokens/revoke, /tokens/revoke-agent and /tokens/revoke-all, under the page's own path. Point them wherever your app handles them.
<div rst-tokens >
<section rst-box >
<form rst-form method ="post" action ="/tokens" >
<div rst-field >
<label rst-field-label for ="agent" >Agent name</label >
<input rst-input type ="text" id ="agent" name ="agent" maxlength ="40" >
</div >
<label rst-switch >
<input type ="checkbox" name ="for_self" value ="on" >
<span rst-switch-track aria-hidden ="true" ></span >
This token is for me, not an agent
</label >
<fieldset rst-choice >
<legend >Access</legend >
<div rst-choice-cards >
<label >
<input type ="radio" name ="access" value ="write" checked >
<span >
<span rst-choice-title >Read and write</span >
</span >
</label >
<label >
<input type ="radio" name ="access" value ="read" >
<span >
<span rst-choice-title >Read only</span >
</span >
</label >
</div >
</fieldset >
<div rst-field >
<label rst-field-label for ="expiry" >Expires</label >
<select rst-input ="short" id ="expiry" name ="expiry" >
<option value ="30" >30 days</option >
<option value ="90" selected >90 days</option >
<option value ="365" >1 year</option >
<option value ="never" >Never</option >
</select >
</div >
<div rst-form-foot >
<button rst-btn ="primary lg" type ="submit" >Create token</button >
</div >
</form >
</section >
<div rst-card rst-tokens-list role ="table" aria-label ="Tokens" >
<div rst-lrow ="head" role ="row" >
<span role ="columnheader" >Token</span >
<span class ="rst-m-hide" role ="columnheader" >Access</span >
<span class ="rst-m-hide" role ="columnheader" >Created</span >
<span class ="rst-m-hide" role ="columnheader" >Last used</span >
<span class ="rst-m-hide" role ="columnheader" >Expires</span >
<span role ="columnheader" ><span class ="rst-sr-only" >Status</span ></span >
<span role ="columnheader" ><span class ="rst-sr-only" >Actions</span ></span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Claude for Grace Hopper</span >
<small >
<code >k3Jx9QpL2mWa</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read and write</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ><time datetime ="2026-08-11" >2026-08-11</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span ><time datetime ="2026-10-31" >2026-10-31</time ></span >
<span rst-tokens-state role ="cell" ></span >
<span role ="cell" >
<details rst-row-menu name ="rst-menus" >
<summary aria-label ="Actions for Claude for Grace Hopper" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="1" /><circle cx ="12" cy ="5" r ="1" /><circle cx ="12" cy ="19" r ="1" /></svg >
</summary >
<div rst-row-menu-panel >
<form method ="post" action ="/tokens/revoke" >
<input type ="hidden" name ="id" value ="k3Jx9QpL2mWa" >
<button type ="submit" >Revoke</button >
</form >
</div >
</details >
</span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Grace Hopper</span >
<small >
<code >Qm2vR8sT4xYb</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read only</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span >Never</span >
<span rst-tokens-state role ="cell" ></span >
<span role ="cell" >
<details rst-row-menu name ="rst-menus" >
<summary aria-label ="Actions for Grace Hopper" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="1" /><circle cx ="12" cy ="5" r ="1" /><circle cx ="12" cy ="19" r ="1" /></svg >
</summary >
<div rst-row-menu-panel >
<form method ="post" action ="/tokens/revoke" >
<input type ="hidden" name ="id" value ="Qm2vR8sT4xYb" >
<button type ="submit" >Revoke</button >
</form >
</div >
</details >
</span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Codex for Grace Hopper</span >
<small >
<code >Zp7wN1cH6kLd</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read and write</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span >Never</span >
<span rst-tokens-state role ="cell" ><span rst-status rst-tone ="neutral" >Revoked</span ></span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Nightly import for Grace Hopper</span >
<small >
<code >Vb4tG9yK3nMe</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read only</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span ><time datetime ="2026-08-11" >2026-08-11</time ></span >
<span rst-tokens-state role ="cell" ><span rst-status rst-tone ="warning" >Expired</span ></span >
</div >
</div >
<div rst-tokens-revoke >
<form method ="post" action ="/tokens/revoke-agent" >
<input type ="hidden" name ="agent" value ="Claude" >
<button rst-btn type ="submit" >Revoke all for this agent: Claude</button >
</form >
<form method ="post" action ="/tokens/revoke-all" >
<button rst-btn ="danger" type ="submit" >Revoke all tokens</button >
</form >
</div >
</div >
In an app this would reach /tokens, /tokens/revoke, /tokens/revoke-agent, /tokens/revoke-all. Here its links and forms go nowhere.
Just created: the secret, shown once
Show this in the response to the create form itself, and do not redirect it: the secret is in that response and nowhere else.
<div rst-tokens >
<div rst-callout rst-tone ="positive" tabindex ="-1" autofocus >
<span rst-callout-ic aria-hidden ="true" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="10" /><path d ="m9 12 2 2 4-4" /></svg >
</span >
<div rst-callout-body >
<strong >Copy this token now. It won't be shown again.</strong >
<p >
<code rst-tokens-secret >harbour_k3Jx9QpL2mWa_6bD2qK9xWz4rT8vN1mP3sL7yF5hJ0cG2aE4uB</code >
</p >
</div >
</div >
<section rst-box >
<form rst-form method ="post" action ="/tokens" >
<div rst-field >
<label rst-field-label for ="agent" >Agent name</label >
<input rst-input type ="text" id ="agent" name ="agent" maxlength ="40" >
</div >
<label rst-switch >
<input type ="checkbox" name ="for_self" value ="on" >
<span rst-switch-track aria-hidden ="true" ></span >
This token is for me, not an agent
</label >
<fieldset rst-choice >
<legend >Access</legend >
<div rst-choice-cards >
<label >
<input type ="radio" name ="access" value ="write" checked >
<span >
<span rst-choice-title >Read and write</span >
</span >
</label >
<label >
<input type ="radio" name ="access" value ="read" >
<span >
<span rst-choice-title >Read only</span >
</span >
</label >
</div >
</fieldset >
<div rst-field >
<label rst-field-label for ="expiry" >Expires</label >
<select rst-input ="short" id ="expiry" name ="expiry" >
<option value ="30" >30 days</option >
<option value ="90" selected >90 days</option >
<option value ="365" >1 year</option >
<option value ="never" >Never</option >
</select >
</div >
<div rst-form-foot >
<button rst-btn ="primary lg" type ="submit" >Create token</button >
</div >
</form >
</section >
<div rst-card rst-tokens-list role ="table" aria-label ="Tokens" >
<div rst-lrow ="head" role ="row" >
<span role ="columnheader" >Token</span >
<span class ="rst-m-hide" role ="columnheader" >Access</span >
<span class ="rst-m-hide" role ="columnheader" >Created</span >
<span class ="rst-m-hide" role ="columnheader" >Last used</span >
<span class ="rst-m-hide" role ="columnheader" >Expires</span >
<span role ="columnheader" ><span class ="rst-sr-only" >Status</span ></span >
<span role ="columnheader" ><span class ="rst-sr-only" >Actions</span ></span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Claude for Grace Hopper</span >
<small >
<code >k3Jx9QpL2mWa</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read and write</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ><time datetime ="2026-08-11" >2026-08-11</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span ><time datetime ="2026-10-31" >2026-10-31</time ></span >
<span rst-tokens-state role ="cell" ></span >
<span role ="cell" >
<details rst-row-menu name ="rst-menus" >
<summary aria-label ="Actions for Claude for Grace Hopper" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="1" /><circle cx ="12" cy ="5" r ="1" /><circle cx ="12" cy ="19" r ="1" /></svg >
</summary >
<div rst-row-menu-panel >
<form method ="post" action ="/tokens/revoke" >
<input type ="hidden" name ="id" value ="k3Jx9QpL2mWa" >
<button type ="submit" >Revoke</button >
</form >
</div >
</details >
</span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Grace Hopper</span >
<small >
<code >Qm2vR8sT4xYb</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read only</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span >Never</span >
<span rst-tokens-state role ="cell" ></span >
<span role ="cell" >
<details rst-row-menu name ="rst-menus" >
<summary aria-label ="Actions for Grace Hopper" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="1" /><circle cx ="12" cy ="5" r ="1" /><circle cx ="12" cy ="19" r ="1" /></svg >
</summary >
<div rst-row-menu-panel >
<form method ="post" action ="/tokens/revoke" >
<input type ="hidden" name ="id" value ="Qm2vR8sT4xYb" >
<button type ="submit" >Revoke</button >
</form >
</div >
</details >
</span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Codex for Grace Hopper</span >
<small >
<code >Zp7wN1cH6kLd</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read and write</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span >Never</span >
<span rst-tokens-state role ="cell" ><span rst-status rst-tone ="neutral" >Revoked</span ></span >
</div >
<div rst-lrow role ="row" >
<span class ="rst-nm" role ="rowheader" ><span rst-actor >Nightly import for Grace Hopper</span >
<small >
<code >Vb4tG9yK3nMe</code >
</small >
</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Access</span >Read only</span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Created</span ><time datetime ="2026-08-02" >2026-08-02</time ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Last used</span ></span >
<span rst-tokens-fact role ="cell" ><span rst-tokens-fact-label >Expires</span ><time datetime ="2026-08-11" >2026-08-11</time ></span >
<span rst-tokens-state role ="cell" ><span rst-status rst-tone ="warning" >Expired</span ></span >
</div >
</div >
<div rst-tokens-revoke >
<form method ="post" action ="/tokens/revoke-agent" >
<input type ="hidden" name ="agent" value ="Claude" >
<button rst-btn type ="submit" >Revoke all for this agent: Claude</button >
</form >
<form method ="post" action ="/tokens/revoke-all" >
<button rst-btn ="danger" type ="submit" >Revoke all tokens</button >
</form >
</div >
</div >
In an app this would reach /tokens, /tokens/revoke, /tokens/revoke-agent, /tokens/revoke-all. Here its links and forms go nowhere.
No tokens yet
<div rst-tokens >
<section rst-box >
<form rst-form method ="post" action ="/tokens" >
<div rst-field >
<label rst-field-label for ="agent" >Agent name</label >
<input rst-input type ="text" id ="agent" name ="agent" maxlength ="40" >
</div >
<label rst-switch >
<input type ="checkbox" name ="for_self" value ="on" >
<span rst-switch-track aria-hidden ="true" ></span >
This token is for me, not an agent
</label >
<fieldset rst-choice >
<legend >Access</legend >
<div rst-choice-cards >
<label >
<input type ="radio" name ="access" value ="write" checked >
<span >
<span rst-choice-title >Read and write</span >
</span >
</label >
<label >
<input type ="radio" name ="access" value ="read" >
<span >
<span rst-choice-title >Read only</span >
</span >
</label >
</div >
</fieldset >
<div rst-field >
<label rst-field-label for ="expiry" >Expires</label >
<select rst-input ="short" id ="expiry" name ="expiry" >
<option value ="30" >30 days</option >
<option value ="90" selected >90 days</option >
<option value ="365" >1 year</option >
<option value ="never" >Never</option >
</select >
</div >
<div rst-form-foot >
<button rst-btn ="primary lg" type ="submit" >Create token</button >
</div >
</form >
</section >
<div rst-empty >
<p rst-empty-body >No tokens yet.</p >
</div >
</div >
In an app this would reach /tokens. Here its links and forms go nowhere.