Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JasonHonKL/spy-search/llms.txt

Use this file to discover all available pages before exploring further.

Spy Search reads its active agent list, LLM provider, and model name from a config.json file at startup. The two endpoints below let you inspect and modify that configuration at runtime — no server restart required. Changes written via POST /agents_selection are immediately visible to subsequent API calls.

GET /get_config

Returns the current agent configuration as stored in config.json. Use this endpoint to confirm which agents are active and which LLM provider and model Spy Search is currently using before making searches or generating reports. Response format: application/json

Response

agents
string[]
The list of active agent names. For example ["reporter"] or ["planner", "searcher", "reporter"].
provider
string
The LLM provider currently configured. For example "openai" or "anthropic".
model
string
The model name currently configured. For example "gpt-4o" or "claude-3-5-sonnet-20241022".

Example

curl http://localhost:8000/get_config
Example response:
{
  "agents": ["reporter"],
  "provider": "openai",
  "model": "gpt-4o"
}

POST /agents_selection

Updates the active agent list, LLM provider, and model name. The new values are written to config.json immediately and will be used by all subsequent requests to search, streaming, and report endpoints. Request format: application/json Response format: application/json

Request Body

The request body must be a JSON object matching the AgentsRequest schema.
agents
string[]
required
The list of agent names to activate. These must correspond to agents registered in the Spy Search factory.Example: ["reporter"] or ["planner", "searcher", "reporter"]
provider
string
required
The LLM provider to use for all subsequent requests.Example: "openai", "anthropic", "ollama"
model
string
required
The model name to pass to the chosen provider.Example: "gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet-20241022"

Response

success
boolean
true if the configuration was written successfully.
agents_received
string[]
Echo of the agent list that was saved to config.json.
model_received
string
Echo of the model name that was saved to config.json.
provider_received
string
Echo of the provider that was saved to config.json.

Example

curl -X POST http://localhost:8000/agents_selection \
  -H "Content-Type: application/json" \
  -d '{
    "agents": ["reporter"],
    "provider": "openai",
    "model": "gpt-4o"
  }'
Example response:
{
  "success": true,
  "agents_received": ["reporter"],
  "model_received": "gpt-4o",
  "provider_received": "openai"
}
Switching to a different model:
curl -X POST http://localhost:8000/agents_selection \
  -H "Content-Type: application/json" \
  -d '{
    "agents": ["planner", "searcher", "reporter"],
    "provider": "anthropic",
    "model": "claude-3-5-sonnet-20241022"
  }'

Error Response

If the write to config.json fails, the endpoint returns HTTP 500 with a detail message:
{
  "detail": "Permission denied: config.json"
}
Changes take effect for new requests immediately. Any search, streaming, or report requests that are already in-flight at the time of the update will continue to use the previous configuration until they complete.

Build docs developers (and LLMs) love