How authentication works
ForgeAI uses Clerk for identity. The Elysia server mounts theelysia-clerk plugin on every route group, which validates the session before your handler runs.
Browser requests are authenticated automatically via the Clerk session cookie set when you sign in to the ForgeAI web app.
Programmatic requests can pass a Bearer token in the Authorization header:
Clerk session tokens are short-lived JWTs. Obtain one from your Clerk dashboard or via the Clerk frontend SDK (
session.getToken()).Unauthenticated requests
If no valid session is present, every endpoint returns:401.
Pro feature gates
Some endpoints (and some parameters on shared endpoints) are gated behind a Pro subscription. ForgeAI checks for the following Clerk feature flags:| Feature flag | What it unlocks |
|---|---|
screenshot_upload | Attach a design screenshot (imageUrl) when creating projects or sending messages |
inline_code_edit | Update files directly in a live sandbox via PATCH /api/fragments/:fragmentId |
403.
Signing in
Create a ForgeAI account
Visit your ForgeAI instance and sign up or sign in using Clerk’s hosted authentication flow.
Use the web app normally
All API calls made from the browser use your session cookie automatically — no extra configuration needed.