Skip to main content
The SettingsResource on figranium.settings lets you read and update your Figranium instance configuration, including API keys, AI provider settings, themes, user agents, and proxy lists. Every method on this resource requires an authenticated browser session, not an API key.
All settings endpoints require new Figranium({ session: true }) and a cookie-aware fetch in Node. See Authentication for setup details.

API Key

Returns the current API key if one exists, or null if none is configured.
  • HTTP: GET /api/settings/api-key
settings-get-api-key.ts
Sets a new API key. If apiKey is omitted, the server generates one automatically. Returns the newly set key.
  • HTTP: POST /api/settings/api-key
settings-set-api-key.ts

User Agent

Returns the current user agent configuration.
  • HTTP: GET /api/settings/user-agent
settings-get-user-agent.ts
Sets the user agent to the given selection string, or clears it when null.
  • HTTP: POST /api/settings/user-agent
settings-set-user-agent.ts

AI Models

Returns the currently configured AI model overrides per provider.
  • HTTP: GET /api/settings/ai-models
  • Return type: AiModels is Partial<Record<AiProvider, string>>, where AiProvider = "gemini" | "openai" | "claude" | "ollama"
settings-get-ai-models.ts
Updates the AI model configuration. Pass only the providers you want to override.
  • HTTP: POST /api/settings/ai-models
settings-set-ai-models.ts

Provider API Keys

Returns the stored API keys for a specific AI provider. The response shape uses openAiApiKeys for OpenAI and ${provider}ApiKeys for other providers; the SDK normalizes this into a standard Record<string, string[]>.
  • HTTP: GET /api/settings/{provider}-api-key (OpenAI uses /api/settings/openai-api-key)
settings-get-provider-keys.ts
Replaces the stored API keys for the given provider.
  • HTTP: POST /api/settings/{provider}-api-key
settings-set-provider-keys.ts

Theme

Returns the currently active UI theme.
  • HTTP: GET /api/settings/theme
  • Return type: Theme = "dark" | "light" | "solarized-light" | "solarized-dark"
settings-get-theme.ts
Changes the active UI theme.
  • HTTP: POST /api/settings/theme
settings-set-theme.ts

Proxies

Returns the full proxy configuration, including the proxy list, rotation mode, and whether the default proxy is included in rotation.
  • HTTP: GET /api/settings/proxies
  • Return type: ProxyList contains proxies?: Proxy[], rotationMode?: "round-robin" | "random" | string, and includeDefaultInRotation?: boolean
settings-list-proxies.ts
Adds a single proxy to the configuration.
  • HTTP: POST /api/settings/proxies
settings-add-proxy.ts
Bulk imports an array of proxies.
  • HTTP: POST /api/settings/proxies/import
settings-import-proxies.ts
Updates an existing proxy by its ID.
  • HTTP: PUT /api/settings/proxies/:id
settings-update-proxy.ts
Removes a single proxy by its ID.
  • HTTP: DELETE /api/settings/proxies/:id
settings-delete-proxy.ts
Removes multiple proxies at once by passing an array of IDs.
  • HTTP: DELETE /api/settings/proxies (body: { ids })
settings-delete-proxies.ts
Sets the default proxy to the given ID, or clears the default when null.
  • HTTP: POST /api/settings/proxies/default
settings-set-default-proxy.ts
Configures how the proxy pool rotates between requests.
  • HTTP: POST /api/settings/proxies/rotation
settings-set-proxy-rotation.ts