How does SatoshiDice operate with 0 confirmations? I understand they use your bet as an input, but what does that mean and how do they do it? Can they use the standard bitcoind as a server against which to run the API from?
This is oversimplified, but here's one sequence showing a serie of payment transactions:

Miner --> You -->  Me -->  SatoshiDice --> Me

So you send half a bitcoin to me and I use a client that lets me send it instantly to SatoshiDICE.   SatoshiDICE then includes at least part of that payment in their win or loss return payout.

Once your payment to me confirms, then mine to SatoshiDICE can confirm.  Once my payment to SatoshiDICE is confirmed, then their payout back to me can confirm.

So if you cheated me and your payment to me was a double spend it will then never confirm (reaching 6 confirmations).  And in turn, my transaction to SatoshiDICE will never confirm.  And in turn, the SatoshiDICE payout transaction back to me will never confirm.

So it doesn't matter that I saw a payout transaction from SatoshiDICE right away, I can't spend it anywhere until it confirms.

Because even a transaction with one or two transactions can get orphaned due to a block reorg and a double spend attack, even if you see a confirmation that doesn't mean the transaction will clear.  That is why, unless there is recourse, only six transactions is the recommended number of confirmations to require.

Here's an example of the transactions for a losing 0.02041833 BTC bet:


http://satoshidice.com/lookup.php?tx=0419fdcbc82add4b46b6fe11e362561d0a3d18329770b36a637a2b60a881cf1e
http://blockchain.info/tx-index/16106266/0419fdcbc82add4b46b6fe11e362561d0a3d18329770b36a637a2b60a881cf1e
http://blockchain.info/tx-index/16106269/e69d7d733d4de5eee6fae0d402fe0db0fdd2544e9ece0f169922d143a8eaf850


You can see the flow visually here:


http://blockchain.info/tree/16104343  (click on the orange dot for the 0.01569037 BTC payment, which was one of the two inputs that paid for the bet.)