title: openai.error.InvalidRequestError: Engine not found
body: <p>Tried accessing the OpenAPI example - <a href="https://beta.openai.com/examples/default-explain-code" rel="nofollow noreferrer">Explain code</a>
  But it shows error as -</p>
  <blockquote>
  <p>InvalidRequestError: Engine not found</p>
  </blockquote>
  <pre><code>enter code response = openai.Completion.create(
  engine=&quot;code-davinci-002&quot;,
  prompt=&quot;class Log:\n    def __init__(self, path):\n        dirname = os.path.dirname(path)\n        os.makedirs(dirname, exist_ok=True)\n        f = open(path, \&quot;a+\&quot;)\n\n        # Check that the file is newline-terminated\n        size = os.path.getsize(path)\n        if size &gt; 0:\n            f.seek(size - 1)\n            end = f.read(1)\n            if end != \&quot;\\n\&quot;:\n                f.write(\&quot;\\n\&quot;)\n        self.f = f\n        self.path = path\n\n    def log(self, event):\n        event[\&quot;_event_id\&quot;] = str(uuid.uuid4())\n        json.dump(event, self.f)\n        self.f.write(\&quot;\\n\&quot;)\n\n    def state(self):\n        state = {\&quot;complete\&quot;: set(), \&quot;last\&quot;: None}\n        for line in open(self.path):\n            event = json.loads(line)\n            if event[\&quot;type\&quot;] == \&quot;submit\&quot; and event[\&quot;success\&quot;]:\n                state[\&quot;complete\&quot;].add(event[\&quot;id\&quot;])\n                state[\&quot;last\&quot;] = event\n        return state\n\n\&quot;\&quot;\&quot;\nHere's what the above class is doing:\n1.&quot;,
        temperature=0,
        max_tokens=64,
        top_p=1.0,
        frequency_penalty=0.0,
        presence_penalty=0.0,
        stop=[&quot;\&quot;\&quot;\&quot;&quot;]
      )
  </code></pre>