claude-api-in-prototypes
FeaturedCall Claude from your HTML artifacts via window.claude.complete
AI & Automation 64,796 stars
10637 forks Updated yesterday CC0-1.0
Install
Quality Score: 91/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Claude API in prototypes
Your HTML artifacts can call Claude via a built-in helper. No SDK or API key needed.
```html
<script>
(async () => {
const text = await window.claude.complete("Summarize this: ...");
// or with a messages array:
const text2 = await window.claude.complete({
messages: [{ role: 'user', content: '...' }],
});
})();
</script>
```
Calls default to `claude-haiku-4-5` with a 1024-token output cap. The body may also set `model` (haiku/sonnet families only), `max_tokens` (up to 32000), `system`, `tool_choice`, and client `tools` — standard Messages API shapes, except each tool also carries `run: async (input) => string` and the helper executes tool calls in-page and loops (max 8 model calls), resolving with the final text. Handler throws become is_error tool_results. Server tools (web search etc.) are rejected; no streaming; rate-limited 15 calls/minute per user, loop iterations included. Shared artifacts run under the viewer's quota.
Details
- Author
- asgeirtj
- Repository
- asgeirtj/system_prompts_leaks
- Created
- 1 years ago
- Last Updated
- yesterday
- Language
- JavaScript
- License
- CC0-1.0
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
claude-api-in-prototypes
Use when integrating Gemini or Claude API endpoints directly into interactive web prototypes
4 Updated today
imMamdouhaboammar AI & Automation Listed
claude
Call Claude models through RunAPI using the Anthropic Messages protocol. Use for Claude chat, streaming, vision, tools, reasoning, token counting, or an existing compatibility client that needs the conditional reference.
0 Updated 1 weeks ago
runapi-ai AI & Automation Listed
claude-api
Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.
0 Updated yesterday
TeiNam