Write a program on python programming language that generate OpenAssistant API. You need to realise only two endpoints - send prompt and getting reply. Use only python3 for it.
user
import requests
import json

class OpenAssistantAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://api.openai.com/v1/engines/openai"

    def send_prompt(self, prompt):
        headers = {
            "Content-Type": "application/json",
            "Authorization": f"Bearer {self.api_key}"
        }
        data = {
            "prompt": prompt,
            "max_tokens": 100,
            "temperature": 0.5
        }
        response = requests.post(f"{self.base_url}/jobs", headers=headers, data=json.dumps(data))

        if response.status_code == 200:
            return response.json()["id"]
        else:
            raise Exception("Failed to send prompt")

    def get_reply(self, job_id):
        headers = {
            "Content-Type": "application/json",
            "Authorization": f"Bearer {self.api_key}"
        }
        response = requests.get(f"{self.base_url}/jobs/{job_id}", headers=headers)

        if response.status_code == 200:
            return response.json()["choices"][0]["text"]
        else:
            raise Exception("Failed to get reply")

if __name__ == "__main__":
    api = OpenAssistantAPI("your_api_key_here")
    job_id = api.send_prompt("Hello, how are you today?")
    reply = api.get_reply(job_id)
    print(reply)
In this program, we first import the requests and json libraries. Then, we define a class OpenAssistantAPI that takes an API key as input and initializes the necessary components for making API requests.

The send_prompt function sends a prompt to the OpenAI API and returns the job ID, which can be used to retrieve the response. The get_reply function retrieves the response given a job ID.

In the main block of the program, we create an instance of the OpenAssistantAPI class with a specified API key, send a prompt, and retrieve the reply, which is printed out to the console.
assistant