curl --request GET \
--url https://api.example.com/api/settings \
--header 'X-Session-API-Key: <api-key>'import requests
url = "https://api.example.com/api/settings"
headers = {"X-Session-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Session-API-Key': '<api-key>'}};
fetch('https://api.example.com/api/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Session-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Session-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/settings")
.header("X-Session-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Session-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent_settings": {
"mcp_config": {},
"agent_kind": "openhands",
"schema_version": 2
},
"conversation_settings": {},
"llm_api_key_is_set": true,
"active_agent_profile_id": "<string>",
"active_meta_profile": "<string>",
"active_profile": "<string>",
"misc_settings": {}
}Get Settings
Get current settings.
Returns the persisted settings including agent configuration, conversation settings, and whether an LLM API key is configured.
Use the X-Expose-Secrets header to control secret exposure:
encrypted: Returns cipher-encrypted values (safe for frontend clients)plaintext: Returns raw secret values (backend clients only!)- (absent): Returns redacted values (”**********”)
Security:
When the server is configured with session_api_keys, all endpoints
under /api (including this one) require the X-Session-API-Key
header. When no session API keys are configured, endpoints are open.
Trust model: All authenticated clients are treated as equally
trusted. There is no role-based authorization for X-Expose-Secrets
modes—any authenticated client can request plaintext or
encrypted exposure. This design assumes:
- All clients sharing session API keys operate in the same trust domain
- Network-level controls (firewalls, VPCs) restrict access to trusted clients only
- Production deployments use session API keys to prevent anonymous access
The plaintext mode exists for backend-to-backend communication
(e.g., RemoteWorkspace). Frontend clients should prefer encrypted
mode for round-tripping secrets, or omit the header to receive redacted
values.
curl --request GET \
--url https://api.example.com/api/settings \
--header 'X-Session-API-Key: <api-key>'import requests
url = "https://api.example.com/api/settings"
headers = {"X-Session-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Session-API-Key': '<api-key>'}};
fetch('https://api.example.com/api/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Session-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Session-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/settings")
.header("X-Session-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Session-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent_settings": {
"mcp_config": {},
"agent_kind": "openhands",
"schema_version": 2
},
"conversation_settings": {},
"llm_api_key_is_set": true,
"active_agent_profile_id": "<string>",
"active_meta_profile": "<string>",
"active_profile": "<string>",
"misc_settings": {}
}Authorizations
Response
Successful Response
Response model for GET /api/settings.
Contains the full settings payload including agent configuration, conversation settings, active LLM profile, miscellaneous frontend-owned settings, and a flag indicating whether an LLM API key is set.
The agent_settings and conversation_settings fields are raw dicts
because the server controls secret serialization via context. Use the
typed accessor methods for validation:
Example::
response = SettingsResponse.model_validate(api_response.json())
agent = response.get_agent_settings() # Returns AgentSettingsConfig
conv = response.get_conversation_settings() # Returns ConversationSettings
misc_settings is an opaque container for frontend-owned data that the
agent-server persists but does not interpret — see the docstring of
:class:PersistedSettings.misc_settings.
Show child attributes
Show child attributes
Stable id of the currently active AgentProfile, if one is set.
Name of the currently active meta-profile, if one is selected.
Name of the currently active LLM profile, if one is selected.
Was this page helpful?

