AI Generation
AI-powered content generation actions and their credit costs.
Description
The AI module powers every AI-assisted writing feature in the product — rewriting a section,
generating a cover letter, tailoring a resume to a job description, and more. GET /ai/actions
lists every action along with its Standard and Expert mode credit costs so you can build pricing UI
before calling POST /ai/generate.
Credits use a two-phase reserve → commit/release flow: the cost for the chosen action and mode is reserved from the caller's AI credit wallet before the AI provider is called, and only committed after a successful response. If the AI call errors out, the reservation is released instead of committed — a failed generation never burns credits.
Expert mode routes to a stronger, more expensive model than Standard mode for the same action.
Read pricing at runtime
Credit costs come from server-side configuration and can change without a documentation update.
Treat GET /ai/actions as the only source of truth for pricing rather than hardcoding numbers.
Authentication
| Method | Access Level | Requirement |
|---|---|---|
GET | Authenticated | No user session and no scope needed, but still requires an API key or a first-party origin. |
POST | Authenticated | A user session, or an API key carrying the ai:write scope. Anonymous callers are rejected. |
GET /ai/actions is not open to the public. It returns no user data and spends no credits, but a
request that carries neither an API key nor a whitelisted first-party origin is still rejected
with 401.
Available Endpoints
GET /ai/actions— List AI ActionsPOST /ai/generate— Generate AI Content
Verify Public Share Link PasswordPOST
Verifies a password-protected share link's password using a timing-safe comparison against the stored scrypt hash, and returns the full snapshot on success. No user session is required, but the request must carry an API key or originate from a whitelisted first-party origin, same as the read endpoint. **Rate limited to 3 attempts per 5 minutes per IP** — considerably tighter than the rest of the API, to make these links impractical to brute-force.
List AI ActionsGET
Lists every available AI generation action along with its Standard and Expert mode credit costs. Use this to build pricing UI before calling `/ai/generate`. Costs only — no user data is returned, and no credits are spent. This endpoint carries no scope requirement, but it is not open to the public: the request must carry an API key or originate from a whitelisted first-party origin, or it is rejected with `401`. The response always contains an entry for all seven action keys. **Treat this endpoint as the only source of truth for pricing** — the actual credit values come from server-side configuration and can change without a documentation update, so read them at runtime rather than hardcoding the illustrative numbers shown here.