If you don't need a content of the error message this is sufficient:
@api.get("/my-route/", responses={404: {}, 500: {}})