Metadata-Version: 2.1
Name: openaiapi
Version: 0.0.1
Summary: A light wrapper around the OpenAI API using apiron
Home-page: https://github.com/daneah/openaiapi
Author: Dane Hillard
Author-email: "Dane Hillard" <github@danehillard.com>
License: MIT License
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

# openaiapi

A light wrapper around the OpenAI API using [apiron](https://apiron.readthedocs.org).

## Installation

```shell
$ python -m pip install openaiapi
```

## Usage

First, make an `OPENAI_API_KEY` environment variable available whose value is your OpenAI API key. Once you have an API in place, you can use the `OpenAI` class to generate content:

```python
>>> from openaiapi import OpenAI
>>> OpenAI.completions(json={"model": "text-davinci-003", "prompt": "What is your quest?"})
{..., 'choices': [{'text': '\n\nMy quest is to find my purpose and fulfill it.', ...}], ...}}
```

See the package documentation for the full list of available endpoints, and see [the OpenAI documentation](https://beta.openai.com/docs/api-reference/introduction) for the accepted/required parameters to each endpoint.
