This must have been asked many times before I came up with it.
Was the author of "The Never Ending Story" paid by the word?
I was unable to find details on Ende's contract on the Germanophone interwebbertubes, but I think it unlikely. The title may (partially) be a pun on his surname - 'Ende' meaning '(The) End' in German - as well as the book's genesis. Ende had originally announced to his publisher that he had an idea for a story about a boy who literally becomes a part of the story he reads, but that he expected to not be able to wring more than a 100 pages from the idea. The publisher replied "You do that - write a short book for once".
According to Ende, what happened next was that once he started taking the idea seriously "the story exploded in my hands".
When the deadline approached, he had to admit to said publisher that he found himself unable to get the damn brat
out of Phantasia again - "Bastian doesn't want to come back again" - and he strongly implies that he habitually refused to employ cheap author's trick to resolve plot problem. The boy would find a way out on his own, and everybody - publisher, printer, readers - had to have patience until he did (he remarks that at the time, appointments with printers ahd already been made, "the paper was ready (to be printed)")
He found that his original Bastian - a much more asocial, reticent, withdrawn kid than the one in the published version, who lacked the latter's desire for community and social interaction - didn't work, as that Bastian would have no
reason to want to come back to his real life again. So Ende ended up rewriting much of his draft (By his account, the book represents about a fifth of the source material). He handed in the draft more than a year past the original deadline.
https://de.m.wikipedia.org/wiki/Die_unendliche_GeschichteTL;DR - I guess the title may, in part, be an in-joke between Ende and his publisher. And the discrepancy between his original estimate of a hundred pages for a book that grew to nearly five times that length (480 pages) ... dunno how length figured into his remuneration. Ende was not one to suffer indignities in silence - he famously sued (and lost) to have the production of the eponymous movie halted, or the title changed, and insisted his name be withdrawn from the credits - but there is no report about any disagreements about his payment for a book that deviated in many ways from what was initially agreed upon (granted, this would also be congruent with his being paid by page number). What he did seem to have cared about - fanatically so - were his characters and the artistic integrity of his work, and by '79, he seemed to have been in a position to afford such devotion (Previous novels, like Momo, or the Jim Button series, were already bestsellers in Germany in their own right. Methinks Ende occupies a place in German YA fiction similar to Stephen King in the US, though the latter is, of course, much more prolific, and, more importantly, still alive).