Getting rate limit error when using the API. Working fine on Playground

It’s because by default max_tokens is set to 16 on the text completion endpoint. I’d recommend reading API reference before you continue.