OpenAi client, generated from the OpenAPI spec.
```rust use openai::OpenAiClient; use openai::model::*;
async fn main() { let client = OpenAiClient::fromenv(); let response = client.listengines().await.unwrap(); println!("{:#?}", response); } ```
This example loads configuration from environment variables, specifically:
OPENAI_API_KEY
- Your OpenAI API keyAdd this to your Cargo.toml:
toml
[dependencies]
openai2 = "2"
The crate is named openai2
, but it is imported as openai
:
rust
use openai;
You can see working examples of every API call in the examples/
directory.
Contributions are welcome!
Library created with Libninja.