Skip to main content
An agent is a saved configuration on top of a model you have already deployed. It stores the system prompt, built-in tools, MCP servers, knowledge bases, and loop limits. You create and edit agents in the dashboard. You run them with the API. The run endpoint streams AG-UI events. Tools, MCP servers, knowledge bases, and the system prompt always come from the stored agent. A tools array on the request is accepted for protocol compatibility and does not add capabilities.

What you configure

Built-in tools: When the agent has knowledge bases, SynapsAI also attaches search_knowledge_base and retrieve_knowledge_base_content. Those are not listed in the tool picker. MCP servers use streamable_http or sse and require a url. Each server needs a name. Stdio MCP is disabled unless the deployment explicitly allows it.

Run an agent

POST /v1/agent/{agent_id}/run returns text/event-stream. Authenticate with your API key. The key must be allowed to call the agent’s model.
The Python SDK accepts plain strings, message dicts, or AgentMessage objects. It fills in threadId and runId when you omit them. The JSON body uses AG-UI camelCase (threadId, runId, forwardedProps). state can override max_steps and compress_context for that run. It cannot change tools, MCP servers, knowledge bases, or the system prompt.

Send a conversation

messages can be a list of turns. Include prior user and assistant messages, then the latest user message.

Events

Python SDK

Create and edit the agent in the dashboard. Run it from the SDK against https://api.synapsai.cloud/v1. The SDK turns strings and message dicts into the AG-UI body and yields parsed events.
AsyncSynapsAI supports async for event in client.agents.run(...). Optional arguments include thread_id, run_id, and state (max_steps, compress_context). Passing tools does not add tools beyond the saved agent.

Billing

Each model call inside the loop goes through /v1/chat/completions, so usage, tracing, and rate limits apply to the underlying model. The agent id scopes which configuration is loaded; it is not a separate inference endpoint for the model itself. Enable the data store on the agent if you want runs retained. See Responses for the same store behavior on /v1/responses.