Liking cljdoc? Tell your friends :D

openai-clj Clojars Project

A simple, fast and robust Clojure client library for accessing the OpenAI API.

This library is unofficial, meaning it is community-maintained.

Documentation

Authentication

Set your environment variables to: OPENAI_API_KEY and/or OPENAI_ORGANIZATION to authenticate with the OpenAI API.

For another alternative to access your api key and organization, access the authentication documentation.

Quickstart

Demonstration of a simple library use case. For more specific demonstrations, access the usage documentation.

Add namespace in your project:

(:require [openai-clj.completion :as completion])

Creates a completion:

(completion/create-completion {:model  "gpt-3.5-turbo-instruct"
                               :prompt "Say this is a test"})

Contributing

Contributions are welcome! Please feel free to open new issues and submit pull requests.

Acknowledgements

This library was inspired by wkok/openai-clojure, which served as a base and learning experience for me to delve even deeper into the Clojure language.

License

openai-clj is made with ❤️ by Ygor Simões and it's released under the MIT license.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close