# Chatbox starter


# A chatbox you can run in one minute

A tiny streaming chatbox in plain HTML, CSS and JavaScript. No framework, no build step,
    no dependencies. Paste your API key and it talks to AxForge — replies stream in as they are
    generated. The API speaks the OpenAI shape, so the same code runs against any
    OpenAI-compatible endpoint by changing two lines.

Open the live demo
    Download the ZIP

Need a key? Create one — new accounts include
    free serverless tokens each month.

## Three fields, and it works

The only AxForge-specific parts are the base URL, your key and the model name. Everything
    else is the standard OpenAI request shape.

```
const res = await fetch("https://api.axforge.ai/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer " + YOUR_KEY,
  },
  body: JSON.stringify({
    model: "qwen3.8-27b",
    messages: [{ role: "user", content: "Hello!" }],
    stream: true,
  }),
});
```

The download reads the streamed reply token by token and prints it. That loop is the other
    interesting part of `app.js` — about a dozen lines, commented.

## Four files, nothing hidden

Read it, change it, keep it. There is no toolchain to learn.

      | File | What it does |  |

      | `index.html` | The page: a settings panel for your key and model, a message log, and the composer. Open it in a browser. |  |

      | `app.js` | The logic: send the conversation, read the SSE stream, render each token. About 120 lines — start here. |  |

      | `styles.css` | Self-contained styling, no framework, safe to replace with your own. |  |

      | `README.md` | How to run it two ways, how to get a key, and the note on keys in the browser. |  |

## Keys in the browser are for trying it out

This starter calls the API straight from the browser, so your key is in the page and stored
    only in your browser. That is fine for experimenting on your own machine. For anything public,
    keep the key on a small server and have the browser talk to that server instead — never ship a
    real key in front-end code. The chat reference shows the server-side
    shape, and the quickstart gets you a key and a first call.



Source: https://axforge.ai/docs/starters/
