In a large saucepan (or two kettles) sauté the onions, celery, and apples in the butter until the mixture is soft but not browned. Add the curry powder and sauté for 2 minutes more, then add the flour, stirring well. Cook, stirring, for a minute or so more. Gradually stir in the chicken stock or broth and cook the soup until it thickens. Add the salt, chili powder, and cayenne to taste.