With the hope of selling it, as opposed to on commission (for hire).(adverb)
Wiktionary.org : Text is available under the Creative Commons Attribution-ShareAlike License
Use "on spec" in a sentence
"If an original screenplay is commissioned by a producer, or written on spec by a writer and then purchased by a producer, there may be an effort to make a book deal before a financier-distributor gets involved."