copilot.py
cors_allowed_origins replaces the AgentOS defaults. Include every browser and AgentOS UI origin that needs to call the backend.
Run the API
1
Set up your virtual environment
2
Install dependencies
3
Export your OpenAI API key
4
Run PgVector
5
Start AgentOS
Save the code as
copilot.py, then run:Calling it from a surface
Every run endpoint takes the same shape, whether the caller is a browser widget or a backend job.AgentOS endpoints
Browse the live OpenAPI spec at the
/docs endpoint of your running AgentOS.
Custom routes
AgentOS is a FastAPI app. Add routes for webhooks, dashboards, or product-specific endpoints. The agent is a regular Python object you can call from anywhere.
Auth
Setauthorization=True to require a valid JWT on protected central routes. Set JWT_VERIFICATION_KEY or JWT_JWKS_FILE before building the app. Add user_isolation=True to filter user-scoped data for non-admin callers.
sub pins user_id, and the scopes claim drives RBAC. An optional session_id claim overrides the form value; otherwise the client supplies the session ID with the request.