Skip to main content
The 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
Settings methods typically require .session authentication. API-key access is usually insufficient for administrative endpoints such as API key rotation and proxy management.

Methods

Read or rotate the server’s API key.
  • HTTP endpoints: GET /api/settings/api-key and POST /api/settings/api-key
  • Signatures:
    • getAPIKey(options: RequestOptions = .init()) async throws -> JSONObject
    • setAPIKey(_ key: String? = nil, options: RequestOptions = .init()) async throws -> JSONObject
Pass nil to setAPIKey to let the server generate a new key automatically.
api_key.swift
Read or change the browser user agent selection.
  • HTTP endpoints: GET /api/settings/user-agent and POST /api/settings/user-agent
  • Signatures:
    • getUserAgent(options: RequestOptions = .init()) async throws -> JSONObject
    • setUserAgent(_ selection: String?, options: RequestOptions = .init()) async throws -> JSONObject
user_agent.swift
Read or update the AI model configuration.
  • HTTP endpoints: GET /api/settings/ai-models and POST /api/settings/ai-models
  • Signatures:
    • getAIModels(options: RequestOptions = .init()) async throws -> JSONObject
    • setAIModels(_ models: JSONObject, options: RequestOptions = .init()) async throws -> JSONObject
ai_models.swift
Read or change the UI theme.
  • HTTP endpoints: GET /api/settings/theme and POST /api/settings/theme
  • Signatures:
    • getTheme(options: RequestOptions = .init()) async throws -> JSONObject
    • setTheme(_ theme: String, options: RequestOptions = .init()) async throws -> JSONObject
theme.swift
Manage the proxy list used by browser sessions.
  • HTTP endpoints:
    • GET /api/settings/proxies
    • POST /api/settings/proxies
    • POST /api/settings/proxies/import
    • PUT /api/settings/proxies/{id}
    • DELETE /api/settings/proxies/{id}
    • DELETE /api/settings/proxies
    • POST /api/settings/proxies/default
    • POST /api/settings/proxies/rotation
  • Signatures:
    • listProxies(options: RequestOptions = .init()) async throws -> JSONObject
    • addProxy(_ proxy: ProxyInput, options: RequestOptions = .init()) async throws -> JSONObject
    • importProxies(_ proxies: [ProxyInput], options: RequestOptions = .init()) async throws -> JSONObject
    • updateProxy(_ id: String, proxy: ProxyInput, options: RequestOptions = .init()) async throws -> JSONObject
    • deleteProxy(_ id: String, options: RequestOptions = .init()) async throws -> JSONObject
    • deleteProxies(_ ids: [String], options: RequestOptions = .init()) async throws -> JSONObject
    • setDefaultProxy(_ id: String?, options: RequestOptions = .init()) async throws -> JSONObject
    • setProxyRotation(_ input: JSONObject, options: RequestOptions = .init()) async throws -> JSONObject
proxies.swift
ProxyInput contains server, optional username, password, label, isRotatingPool, and estimatedPoolSize.
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-key for OpenAI)
  • Signatures:
    • providerKeys(_ provider: String, options: RequestOptions = .init()) async throws -> JSONObject
    • setProviderKeys(_ provider: String, keys: [String], options: RequestOptions = .init()) async throws -> JSONObject
For "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

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.