SettingsResource on client.settings lets you read and write server-level configuration. You can rotate API keys, change the user agent, set AI provider models, switch themes, and manage proxy lists. Most of these operations require session authentication (.session) because they affect the entire server instance.
SettingsResource.swift
Methods
getAPIKey / setAPIKey
getAPIKey / setAPIKey
Read or rotate the server’s API key.
- HTTP endpoints:
GET /api/settings/api-keyandPOST /api/settings/api-key - Signatures:
getAPIKey(options: RequestOptions = .init()) async throws -> JSONObjectsetAPIKey(_ key: String? = nil, options: RequestOptions = .init()) async throws -> JSONObject
nil to setAPIKey to let the server generate a new key automatically.api_key.swift
getUserAgent / setUserAgent
getUserAgent / setUserAgent
Read or change the browser user agent selection.
- HTTP endpoints:
GET /api/settings/user-agentandPOST /api/settings/user-agent - Signatures:
getUserAgent(options: RequestOptions = .init()) async throws -> JSONObjectsetUserAgent(_ selection: String?, options: RequestOptions = .init()) async throws -> JSONObject
user_agent.swift
getAIModels / setAIModels
getAIModels / setAIModels
Read or update the AI model configuration.
- HTTP endpoints:
GET /api/settings/ai-modelsandPOST /api/settings/ai-models - Signatures:
getAIModels(options: RequestOptions = .init()) async throws -> JSONObjectsetAIModels(_ models: JSONObject, options: RequestOptions = .init()) async throws -> JSONObject
ai_models.swift
getTheme / setTheme
getTheme / setTheme
Read or change the UI theme.
- HTTP endpoints:
GET /api/settings/themeandPOST /api/settings/theme - Signatures:
getTheme(options: RequestOptions = .init()) async throws -> JSONObjectsetTheme(_ theme: String, options: RequestOptions = .init()) async throws -> JSONObject
theme.swift
Proxy management
Proxy management
Manage the proxy list used by browser sessions.
- HTTP endpoints:
GET /api/settings/proxiesPOST /api/settings/proxiesPOST /api/settings/proxies/importPUT /api/settings/proxies/{id}DELETE /api/settings/proxies/{id}DELETE /api/settings/proxiesPOST /api/settings/proxies/defaultPOST /api/settings/proxies/rotation
- Signatures:
listProxies(options: RequestOptions = .init()) async throws -> JSONObjectaddProxy(_ proxy: ProxyInput, options: RequestOptions = .init()) async throws -> JSONObjectimportProxies(_ proxies: [ProxyInput], options: RequestOptions = .init()) async throws -> JSONObjectupdateProxy(_ id: String, proxy: ProxyInput, options: RequestOptions = .init()) async throws -> JSONObjectdeleteProxy(_ id: String, options: RequestOptions = .init()) async throws -> JSONObjectdeleteProxies(_ ids: [String], options: RequestOptions = .init()) async throws -> JSONObjectsetDefaultProxy(_ id: String?, options: RequestOptions = .init()) async throws -> JSONObjectsetProxyRotation(_ input: JSONObject, options: RequestOptions = .init()) async throws -> JSONObject
proxies.swift
ProxyInput contains server, optional username, password, label, isRotatingPool, and estimatedPoolSize.providerKeys / setProviderKeys
providerKeys / setProviderKeys
Read or write provider-specific API keys. The SDK normalizes the URL path and body key name based on the provider string.
- HTTP endpoints:
GET /api/settings/{provider}-api-key(or/api/settings/openai-api-keyfor OpenAI) - Signatures:
providerKeys(_ provider: String, options: RequestOptions = .init()) async throws -> JSONObjectsetProviderKeys(_ provider: String, keys: [String], options: RequestOptions = .init()) async throws -> JSONObject
"openai", the SDK calls /api/settings/openai-api-key and sends "openAiApiKeys" in the body. For any other provider, it calls /api/settings/{provider}-api-key and sends "{provider}ApiKeys".provider_keys.swift
Related resources
Authentication
Use
.session authentication for settings endpoints.Request options
Pass custom headers and per-request timeouts.
Errors
Handle
FigraniumError responses.Client configuration
Configure base URL, timeouts, and default headers.