[package]
edition = "2024"
rust-version = "1.86"
name = "rai-sdk"
version = "0.2.0"
authors = ["Ronnie Andrew Magatti <ronniemagatti@gmail.com>"]
build = false
exclude = [
"/.github/",
"/target/",
"/.gitignore",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Rust AI SDK — unified client for OpenAI, Anthropic, and OpenRouter with typed models, structured output, tool calling, and streaming"
homepage = "https://rmagatti.github.io/rai-sdk/"
documentation = "https://docs.rs/rai-sdk"
readme = "README.md"
keywords = [
"ai",
"llm",
"openai",
"anthropic",
"openrouter",
]
categories = [
"api-bindings",
"asynchronous",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rmagatti/rai-sdk"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
anthropic = []
default = [
"openai",
"anthropic",
"openrouter",
"rustls-tls",
]
native-tls = ["reqwest/native-tls"]
openai = []
openrouter = []
rustls-tls = ["reqwest/rustls"]
[lib]
name = "rai_sdk"
path = "src/lib.rs"
[[example]]
name = "basic_chat"
path = "examples/basic_chat.rs"
[[example]]
name = "local_model"
path = "examples/local_model.rs"
required-features = ["openai"]
[[example]]
name = "sse_proxy"
path = "examples/sse_proxy.rs"
required-features = ["openai"]
[[example]]
name = "structured_output"
path = "examples/structured_output.rs"
[[example]]
name = "tool_calling"
path = "examples/tool_calling.rs"
[[test]]
name = "config"
path = "tests/config.rs"
[[test]]
name = "messages"
path = "tests/messages.rs"
[[test]]
name = "models"
path = "tests/models.rs"
[[test]]
name = "openai_compatible"
path = "tests/openai_compatible.rs"
[[test]]
name = "streaming_tools"
path = "tests/streaming_tools.rs"
[[test]]
name = "wire_events"
path = "tests/wire_events.rs"
[[test]]
name = "wire_stream"
path = "tests/wire_stream.rs"
[dependencies.async-stream]
version = "0.3"
[dependencies.bytes]
version = "1"
[dependencies.futures]
version = "0.3"
[dependencies.jsonschema]
version = "0.49"
default-features = false
[dependencies.rand]
version = "0.10"
[dependencies.reqwest]
version = "0.13"
features = [
"json",
"stream",
"charset",
"http2",
"system-proxy",
]
default-features = false
[dependencies.schemars]
version = "1.2"
[dependencies.serde]
version = "1"
features = ["derive"]
[dependencies.serde_json]
version = "1"
[dependencies.thiserror]
version = "2"
[dependencies.tokio]
version = "1"
features = ["full"]
[dependencies.tokio-stream]
version = "0.1"
[dependencies.tracing]
version = "0.1"
[dev-dependencies.axum]
version = "0.8"
[dev-dependencies.serial_test]
version = "4"
[dev-dependencies.tokio-test]
version = "0.4"
[dev-dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]
[dev-dependencies.wiremock]
version = "0.6"
[lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"
[lints.rustdoc]
broken_intra_doc_links = "deny"
private_intra_doc_links = "warn"