Manage user-specific settings including display preferences, themes, AI model configuration, and API keys.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/better-auth/better-hub/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/user-settings
Retrieve current user settings.Response
User ID
User’s display name
UI theme preference:
"light", "dark", or "system"Default: "system"Color theme nameDefault:
"better-auth"Color mode:
"light" or "dark"Default: "dark"AI model for Ghost chatDefault:
"auto"Whether user is using their own OpenRouter API keyDefault:
falseMasked OpenRouter API key (last 4 characters visible)Returns
null if not set, or "****XXXX" format if setMasked GitHub Personal Access Token (last 4 characters visible)Returns
null if not set, or "****XXXX" format if setCode syntax theme for light modeDefault:
"vitesse-light"Code syntax theme for dark modeDefault:
"vitesse-black"Code font familyDefault:
"default"Code font size in pixelsDefault:
13, Range: 8-32Whether user has completed onboardingDefault:
falseLast update timestamp (ISO 8601)
PATCH /api/user-settings
Update user settings. Only provided fields will be updated.User’s display name (max 100 characters)
UI theme:
"light", "dark", or "system"Color theme name (max 50 characters)
Color mode:
"light" or "dark"AI model identifier (max 100 characters)Examples:
"auto", "gpt-4", "claude-3-opus"Enable/disable using own OpenRouter API key
OpenRouter API key (max 500 characters)Set to
null to remove the keyGitHub Personal Access Token (max 500 characters)Set to
null to remove the tokenCode theme for light mode (max 100 characters)
Code theme for dark mode (max 100 characters)
Code font family (max 100 characters)
Code font size in pixels (8-32)
Mark onboarding as complete
Response
Returns the updated settings object with the same structure as GET.Settings Validation
Field Constraints
| Field | Type | Min | Max | Default |
|---|---|---|---|---|
| displayName | string | - | 100 chars | - |
| theme | enum | - | - | “system” |
| colorTheme | string | - | 50 chars | ”better-auth” |
| colorMode | enum | - | - | “dark” |
| ghostModel | string | - | 100 chars | ”auto” |
| openrouterApiKey | string | - | 500 chars | null |
| githubPat | string | - | 500 chars | null |
| codeThemeLight | string | - | 100 chars | ”vitesse-light” |
| codeThemeDark | string | - | 100 chars | ”vitesse-black” |
| codeFont | string | - | 100 chars | ”default” |
| codeFontSize | number | 8 | 32 | 13 |
Theme Values
UI Theme (theme):
"light"- Always light mode"dark"- Always dark mode"system"- Follow system preference
colorMode):
"light"- Light color palette"dark"- Dark color palette
AI Model Configuration
Ghost Model (ghostModel):
"auto"- Automatic model selection based on task- Specific model IDs (e.g.,
"gpt-4","claude-3-opus")
useOwnApiKey is true, the specified ghostModel will be used with the user’s openrouterApiKey.