OPENAI_API_KEY.js

    0

    0

    console.log(response.

    const { Configuration, OpenAIApi } = require("openai");
    
    //sk-HfkBz0GOqtb117am9iUuT3BlbkFJ7acKVh5At8Fz1Z6ZmrwFcdfc
    
    const configuration = new Configuration({
      apiKey: process.env.OPENAI_API_KEY,
    });
    const openai = new OpenAIApi(configuration);
    
    const response = await openai.createCompletion({
      model: "text-davinci-003",
      prompt: "write redux rtk query for me\n",
      temperature: 1,
      max_tokens: 4000,
      top_p: 1,
      frequency_penalty: 0,
      presence_penalty: 0,
    });
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.