quick_start/quick_start.rs
1//! Quick start example - minimal code to get GPT-5 working
2//!
3//! This is the absolute minimum code needed to use GPT-5
4//! Run with: cargo run --example quick_start
5
6use gpt5::{Gpt5Client, Gpt5Model};
7
8#[tokio::main]
9async fn main() -> Result<(), Box<dyn std::error::Error>> {
10 // 1. Create client
11 let client = Gpt5Client::new("your-api-key-here".to_string());
12
13 // 2. Ask a question
14 let response = client.simple(Gpt5Model::Gpt5Nano, "Hello, world!").await?;
15
16 // 3. Print response
17 println!("{}", response);
18
19 Ok(())
20}