Running the server
The agent server is a FastAPI application served by Uvicorn. The search2o command starts the server and passes any further options to Uvicorn.
Start
$ export SEARCH2O_LICENSE_KEY=your-license-key
$ search2o # 127.0.0.1:9020
$ search2o --host 0.0.0.0 --port 8080
$ SEARCH2O_LICENSE_KEY=... ANTHROPIC_API_KEY=... search2o # key, one LLM key, startOther command line options are passed through to Uvicorn. The --reload family, --factory and --workers are refused: the server always runs one worker, and capacity comes from more servers rather than more workers. See Agent servers.
LLM keys
A new account comes with LLM profiles for OpenAI, Anthropic and Gemini. Each profile reads its API key from an environment variable on the server. Set the variable for the provider you use before starting the server:
$ export OPENAI_API_KEY=sk-...
$ export ANTHROPIC_API_KEY=sk-ant-...
$ export GEMINI_API_KEY=...One key is enough to start. Search2o is not limited to these three vendors; see Connecting to other LLMs. Where secrets come from is configurable; see Secrets.
What starts up
At startup the server validates the license and downloads the account's configuration from Search2o Cloud. The server then checks every entry of the expression allowlist against its own Python environment and builds its connection pools. After that the server serves:
- the GUI at
/ui, - the OpenAPI schema at
/openapi.json, Swagger UI at/docsand ReDoc at/redoc, - the REST API under
/api/.
The three documentation paths, the UI path and the allowed CORS origins are set in the Agent servers configuration. Each path can also be removed: a server can run with no GUI and no interactive API documentation.
Running in production
The server holds no state. Moving from a laptop to a shared server, or from one server to a cluster, changes nothing in the agents or in the configuration. Start as many servers as you need with the same license key and put them behind any load balancer. Each server brings itself up to date with the account's configuration on every agent run.
To let colleagues try Search2o, add them to the account and start one server in a common place in your organization.
One thing to check when choosing where a server runs: the APIs and databases your agents call must be reachable from that place.

