---
name: "claude-api-in-prototypes"
description: "Claude API in prototypes\nCall Claude from your HTML artifacts via window.claude.complete"
---
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 use `claude-haiku-4-5` with a 1024-token output cap (fixed — shared artifacts run under the viewer's quota). The call is rate-limited per user.
