# No-backend AI chat with Switchboard

Switchboard lets browser and mobile apps call AI without embedding provider
secrets. Your app uses a hosted project backend URL, a publishable project key,
and an end-user session token.

## Flow

1. Create a Switchboard project.
2. Copy the hosted backend URL from the Integration Kit.
3. Register allowed origins for web apps.
4. Install `@switchboard/sdk`.
5. Register or sign in the end user.
6. Call OpenAI-compatible chat through the hosted backend.

## Client-safe credentials

- `sb_pub_test_` and `sb_pub_live_` keys are publishable project keys.
- `sb_eusr_` tokens represent end-user sessions.
- `sb_test_`, `sb_live_`, and `sb_sess_` credentials must stay server-side.

Never put provider API keys or Switchboard secret keys in browser or mobile
code.

## Chat behavior

Switchboard authenticates the end user, checks billing state, meters token
usage, calls the provider, and streams the response back to the app.

Use `/docs` for the public quickstart and `/v1/openapi.json` for the API
contract.
