# A34 API quick reference

All routes use `/aichat34/api/` and a dedicated `aichat34-api` Worker with D1 binding `AICHAT34_DB`.

Core routes: `/auth/me`, `/auth/google`, `/auth/logout`, `/chat`, `/custom-games/list`, `/custom-games/detail`, `/custom-games/create`, `/custom-games/delete`, `/cgame2/list`, `/cgame2/save`, `/cgame2/delete`, `/share/*`, `/generate-image`, `/payment/*`, `/credits/spend`.

Authentication uses the `a34sid` HttpOnly cookie. User/game/chat/credit tables are created empty in a new A34-only D1 database; only the public game catalog migration is copied. No A31 account IDs, private chat history, credits, payment rows or secrets are migrated.

`OPENROUTER_API_KEY` is a Cloudflare Worker Secret and is never included in source files. If it is not configured, the AI path should fail safely without charging credits. Payment endpoints require their own credentials and must not be enabled until configured.
