POST /mltk/aicommander
POST /mltk/aicommander
Upsert a provider / connection / model configuration.
edit_ai_commander_configlist_ai_commander_config
Description. Upsert a provider / connection / model configuration. The payload is the entire JSON config blob the UI maintains; secrets (API keys, tokens) are forwarded to Splunk's password storage and removed from the saved KV record.
Body (JSON). Provider-specific. Common fields:
| Field | Type | Notes |
|---|---|---|
service |
string | OpenAI, Azure_OpenAI, Anthropic, Bedrock, Groq, Gemini, Ollama, Splunk_Hosted_Models |
connection_name |
string | Free-form |
model |
string | Provider model id |
servicesettings.endpoint.value |
string | Provider base URL |
servicesettings.access_token.value |
string | API key (moved to password store) |
servicesettings.request_timeout.value |
int | Seconds |
servicesettings.azure_api_version.value |
string | Azure only |
servicesettings.region.value |
string | Bedrock |
servicesettings.aws_access_key_id.value |
string | Bedrock |
servicesettings.aws_access_token.value |
string | Bedrock |
servicesettings.role_arn.value |
string | Bedrock |
modelsettings.max_tokens.value |
int | |
modelsettings.response_variability.value |
number | 0.0–1.0 (temperature) |
Response (200).
{
"message": "Service settings updated successfully",
"updated_config": { /* echoed */ },
"status": "success"
}
Example.
curl -sk -u "$SPLUNK_USER:$SPLUNK_PASSWORD" -X POST
-H "Content-Type: application/json"
--data @- "$SPLUNK_HOST/servicesNS/nobody/Splunk_ML_Toolkit/mltk/aicommander?output_mode=json" <<'JSON'
{
"service": "OpenAI",
"connection_name": "default",
"model": "gpt-4o-mini",
"servicesettings": {
"endpoint": { "value": "https://api.openai.com/v1/chat/completions" },
"access_token": { "value": "sk-..." },
"request_timeout": { "value": 30 }
},
"modelsettings": {
"max_tokens": { "value": 4096 },
"response_variability": { "value": 0.2 }
}
}
JSON