Expand description
§Open Responses
A Rust client library for the Open Responses API specification.
Open Responses is an open-source specification for building multi-provider, interoperable LLM interfaces based on the OpenAI Responses API.
§Quick Start
use openresponses_rust::{Client, CreateResponseBody, Input, Item};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new("your-api-key");
let request = CreateResponseBody {
model: Some("gpt-4o".to_string()),
input: Some(Input::Items(vec![
Item::user_message("Hello, how are you?")
])),
..Default::default()
};
let response = client.create_response(request).await?;
println!("Response: {:?}", response);
Ok(())
}Re-exports§
pub use client::Client;pub use client::ClientError;pub use streaming::StreamingClient;pub use streaming::StreamingError;pub use types::*;