I'm sure this question has been answered before, but, I will answer to the best of my ability. I am not flaired.
tl;dr
The party began in 1919 and anti-semitism was a belief of one of the founders.
Long answer:
The party began as a small, private political group created by Anton Drexler and Karl Harrer, in Munich, Germany. Originally with only 7 members, they went public with their political beliefs on January 5th, 1919, and registered as the DAP, or German Workers Party. They slowly gained political support through the year and became well known to right-wing circles in Munich. Throughout this time they created an organizational structure and membership base that would be crucial to Hitler's rise to power.
Hitler, at the time, worked for Bavarian Reichswehr authorities, and so was asked to report on their activities. He was unimpressed to say the least, but he did feel "good will" in the party. At this time the anti-semitism was in the party, in fact, it was Drexler who spread the message originally and likely lead to Hitler taking his beliefs on to a much more extreme level.
Hitler's public speaking abilities allowed him to climb the ranks quickly, and by 1920 he was chief of propaganda and a member of the executive committee. However, he was disillusioned with the old leadership and they rejected many of his ideals. Since he was the only good public speaker, he choose to bid his time, gather support in the party through new members, and wait until he had enough support for his ideals to be implemented.
During the early 20's the commander of the Reichswehr, Frank von Epp, were attracted to Hitler's style of propaganda, and eventually they supported the DAP with financial aid. Something very important to all this is that the Reichswehr, which at this time began calling itself NSDAP, were like a militia. They protected Hitler and the DAP, so at this point, in Munich, they were untouchable and expanding rapidly. Slowly Hitler undermined the old leadership and exercised more and more power. The membership had grown to about 50,000.
The next major step for Hitler was the Beer-Hall Putsch, in which the DAP attempted to overthrow the government. They failed, but this was important for Hitler, as he learned that direct assault to the government would never work. He realized he had to use his abilities as a speaker to get more people behind him, and win an election legally. Of course, we know what happened from there.
Sources:
http://www.johndclare.net/Rempel_Nazi25.htm
https://www.ushmm.org/wlc/mobile/en/article.php?ModuleId=10007884
Edit: Fixed links