Overview
The Agent API automatically generates a FastAPI server from yourupsonic_config.json configuration. The server exposes a /call endpoint that accepts inputs defined in your input schema and returns outputs matching your output schema.
The API supports both application/json and multipart/form-data content types, making it compatible with web forms, file uploads, and JSON-based clients.
Configure Inputs
Inputs are defined in theinput_schema section of upsonic_config.json:
string: Text inputnumber: Numeric valuesinteger: Whole numbersboolean: True/false valuesarrayorlist: Arrays of valuesjsonorobject: JSON objectsfileorbinary: File uploads
required: true for mandatory inputs and provide default values for optional fields.
Configure Outputs
Outputs are defined in theoutput_schema section:
main() function should return a dictionary matching the output schema structure. The API automatically validates and formats the response according to these definitions.
Run FastAPI of your Agent
Start the FastAPI server with:http://localhost:8000 by default. Customize the host and port:
- Access interactive API docs at
http://localhost:8000/docs - Test the
/callendpoint directly from the Swagger UI - Send HTTP requests to
POST http://localhost:8000/call

