Install with Nimble
nimble install https://github.com/wick3dr0se/openai-nim
Install from source
git clone https://github.com/wick3dr0se/openai-nim; cd openai-nim
# from nimble
import openai
# or from source
import ./openai
Start an asynchronous OpenAI client
var ai = newAIClient(getEnv("AI_TOKEN")
Text chat with openai
echo waitFor ai.chat("Say 'test'")