> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sanfoundation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate SAN with your agent

> Expose SAN’s HTTP endpoints as tools in your server-side agent runtime.

Register each SAN operation your agent needs as a tool in your server runtime. This minimal definition exposes web search with a required query:

```json theme={null}
{
  "name": "san_web_search",
  "description": "Search the live web for sources and return ranked links and snippets.",
  "parameters": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "minLength": 1,
        "maxLength": 512
      }
    },
    "required": ["query"],
    "additionalProperties": false
  }
}
```

Adapt this definition to your framework's registration format, then bind a handler:

1. Send `query` to `GET /v1/web/search`, using the Python, JavaScript, or curl example in the [web search reference](https://docs.sanfoundation.com/api-reference/web-search.md).
2. Attach `Authorization: Bearer` with `SAN_API_KEY` from your environment. Keep credentials and the endpoint outside model-controlled arguments.
3. Return parsed JSON to the agent. Handle failures using the [retry guidance](https://docs.sanfoundation.com/guides/errors.md).

Add [web fetch](https://docs.sanfoundation.com/api-reference/web-fetch.md) when the agent needs to read a source before summarizing it. Use the [OpenAPI specification](https://api.sanfoundation.com/openapi.json) to define other tools, preserving parameter names and limits.

Set a request budget and check [remaining quota](https://docs.sanfoundation.com/api-reference/account.md) before large runs. A search followed by three page fetches can consume four requests. Only call follow-up endpoints when a result includes its required ID; flight follow-ups need the original route and dates.

Preserve source links and timestamps. Treat retrieved text as data, so page instructions cannot change tool permissions or expose secrets.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.