It won't last as well as plywood, and I wouldn't do it myself, but if you are in a not too excessively wet climate and can build sufficient roof overhangs to keep the worst of the weather off the OSB, you have a reasonable chance of getting maybe 5 years out of it if unpainted, a bit more if you paint.
I would not rely on stain to take the place of paint, in this instance, btw. You want something that fills all the bazillions of little holes and crevices and voids, and creates a very solid waterPROOF layer. Also, stain (or more accurately, tinted sealer, which is the only sensible alternative to paint in this case) has to be redone every year or two, so that over time the cost will get to be as high or higher than paint, and the labor greater.
Personally I'd just use plywood - which doesn't cost THAT more, requires less paint, and will last much longer. But I guess I could see using OSB if it's only meant to be a short-term structure and/or if you have a source of very cheap or free OSB but not a source of similarly cheap/free plywood.
Good luck, have fun,
Pat