Function new

Source
pub fn new(api_key: &str) -> Client
Expand description

Returns a new client for the OpenAI API.

§Arguments

  • api_key - The API key to use.

§Example

use openai_rs::client::Client;
use openai_rs::openai;

// Create the Client with your API key.
let client: Client = openai::new("api_key");