Skip to main content

OpenAI API Quickstart - Python example app

This is an example pet name generator app used in the OpenAI API quickstart tutorial. It uses the Flask web framework. Check out the tutorial or follow the instructions below to get set up.

Setup

  1. If you don’t have Python installed, install it from here.

  2. Clone this repository.

  3. Navigate into the project directory:

    $ cd openai-quickstart-python
    
  4. Create a new virtual environment:

    $ python -m venv venv
    $ . venv/bin/activate
    
  5. Install the requirements:

    $ pip install -r requirements.txt
    
  6. Make a copy of the example environment variables file:

    $ cp .env.example .env
    
  7. Add your API key to the newly created .env file.

  8. Run the app:

    $ flask run
    

You should now be able to access the app at http://localhost:5000! For the full context behind this example app, check out the tutorial.

Metadata

Release files for openai-quickstart-python 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openai-quickstart-python 0.4.0
File Size Uploaded
openai_quickstart_python-0.4.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openai-quickstart-python 0.4.0
File Interpreter ABI Platform
openai_quickstart_python-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / openai_quickstart_python-0.4.0.tar.gz

Download URL openai_quickstart_python-0.4.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
09bfdb53e608a982453dcc9a58d4473ba48b42adc2c6c179d1fc3e6d31ef425e
BLAKE2b-256 checksum
How to use checksums
35e36879f2911943dc2ddf6a4a5a2785bd86d66a05883f3493b8022543aad6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.9.2 Linux/5.10.0-23-amd64

Release files / openai_quickstart_python-0.4.0-py3-none-any.whl

Download URL openai_quickstart_python-0.4.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7eb55b4fb53341d92c754c7a3a93796b36a089e7fc7732ad726bf9656074dbe7
BLAKE2b-256 checksum
How to use checksums
8859ec6f3831095f21bbf71dc8c37141e48af3526a7f299951303a211c285615
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.9.2 Linux/5.10.0-23-amd64

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page