Built-in APIs
By default, an Autonomy Node automatically provides these endpoints:POST /agents/{agent_name}- Send messages to a specific agent.POST /agents/{agent_name}?stream=trueSend messages, get streaming responses.GET /agents- List all running agents.GET /agents/{agent_name}- Get details about a specific agent.
Custom APIs with FastAPI
For applications that need custom business logic, data validation, or specialized endpoints, create custom FastAPI routes. Basic Custom API Create a custom endpoint that uses an agent:images/main/main.py
- Use
NodeDepto inject the Node instance into your endpoint - Create agents on-demand or reuse them across requests
- Return custom response formats tailored to your API design
NodeDep dependency provides access to the Autonomy Node reference, which
you need to start agents:
images/main/main.py
Parallel Processing
For high-throughput applications, process multiple requests concurrently by running many agents in parallel:images/main/main.py
- Each item gets its own agent with a unique name.
asyncio.gatherruns all agents concurrently.- Agents are stopped after processing to free resources.
- Errors are caught per-item, so one failure doesn’t break the batch.
Streaming Responses
For long-running agent interactions, stream responses to the client:images/main/main.py
client.ts
API Documentation
FastAPI automatically generates interactive API documentation. Access it at:/docs- Swagger UI interface/redoc- ReDoc interface

