Most AI APIs work in demos and break in production. Here's the complete beginner's guide to designing AI-powered APIs that are secure and reliable.