upnext.Api wraps FastAPI to give you HTTP endpoints that integrate seamlessly with workers. Define routes with familiar decorators, submit work to background tasks, and get automatic request tracking in the dashboard.
Create an API
API options
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | required | API name for dashboard identification |
host | str | "0.0.0.0" | Host to bind to |
port | int | 8000 | Port to listen on |
docs_url | str | "/docs" | Swagger UI path |
openapi_url | str | "/openapi.json" | OpenAPI schema path |
debug | bool | False | Enable debug mode |
redis_url | str | None | Redis URL (falls back to UPNEXT_REDIS_URL env var) |
secrets | list[str] | [] | Secret names to fetch on startup |
Define routes
Use decorator methods that mirror FastAPI:Route groups
Organize related routes under a common prefix:Adopt an existing FastAPI app
If you already have a FastAPI app, wrap it withApi.from_fastapi() to get UpNext’s request tracking and dashboard integration:
Submit work from endpoints
The most common pattern is an API endpoint that submits work to a background worker:Access the FastAPI app
You can access the underlying FastAPI app for advanced configuration:Scaling
upnext.Api is a standard ASGI application powered by FastAPI. Scale it the same way you’d scale any FastAPI app — multiple processes, containers behind a load balancer, or platform-managed replicas. Each instance connects to the same Redis, so task submissions land in the shared queue regardless of which API instance handles the request.
Next: Context
Track progress, save checkpoints, and send structured logs.