title: Google Text-to-Speech Synthesize REST API 500 Internal Error
body: <p>Using Google REST API - usually getting 500 error</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;error&quot;: {
      &quot;code&quot;: 500,
      &quot;message&quot;: &quot;Internal error encountered.&quot;,
      &quot;status&quot;: &quot;INTERNAL&quot;
    }
  }
  </code></pre>
  <p>I have few questions:</p>
  <ul>
  <li>Is it me using API incorrectly?</li>
  <li>Could such behaviour reproduce with any text? Should I add some retry logic?</li>
  </ul>
  <p>I'm using a simple sentence - <code>With Cloud Machine Learning, your application interprets images, texts and so much more.</code> repeated for N times. In this particular case, it's 56 times (4928 chars) to meet the limits of the API which is 5000 chars.
  Reproducing in about 50% times or more.
  Not reproducing with different texts like <code>Lorem Ipsum</code> (500 chars repeated) etc.</p>
  <p><a href="https://jsfiddle.net/vitalii_trinity/4q250rh3/5/" rel="nofollow noreferrer">jsfiddle demo</a> (Google TTS API Key required)</p>