modelrelay 2.2.0

Rust SDK for the ModelRelay API
Documentation
[package]
name = "modelrelay"
# 2.2.0: Add LocalBashToolPack for safe local bash command execution with allow/deny rules.
# 2.1.0: Add get_or_create_customer_token helper that upserts customer before minting token.
# 2.0.0: Breaking - remove subscription_id from customer balance response (wallet decoupled from subscription).
# 1.6.0: Breaking - rename billing customer to billing profile.
# 1.4.0: Restore TiersClient (list, get, checkout) for tier querying operations.
# 1.3.0: Flatten billing response types (return inner types directly, not wrappers).
# 1.2.0: Add BlockingBillingClient (features = ["blocking", "billing"]) for sync billing operations.
# 1.1.0: Add BillingClient (feature = "billing") for customer self-service operations.
# 1.0.0: Stable release - version parity with Go/TypeScript SDKs. Remove simple CRUD clients.
# 0.119.0: Remove simple CRUD clients (Customers, Tiers, Models) - use raw API for these endpoints.
# 0.118.0: Add PAYGO customer balance/topup endpoints and tier billing_mode fields.
# 0.116.0: Make tier_code optional (Option<TierCode>) in CustomerToken for BYOB projects without subscriptions.
# 0.115.0: Breaking - Rename WebToolIntent::FetchUrl to FetchURL.
# 0.113.0: Breaking - TierModel fields renamed: input_price_per_million_cents → model_input_cost_cents, output_price_per_million_cents → model_output_cost_cents.
# 0.112.0: Add workflow.v1 condition and binding helper functions.
# 0.111.1: Fix v1 conformance test - omit empty pointer field in bindings.
# 0.111.0: Add workflow.v1 builders/types + compile helpers.
# 0.110.0: Add workflow.v1 schema support + OpenAPI schema endpoint update.
# 0.109.0: Add image pinning (get, pin, unpin) and sessions client for multi-turn conversations.
# 0.108.0: Add session-linked runs (session_id) helpers for server-managed sessions.
# 0.107.0: Add placeholder binding methods to fluent workflow builder (bind_to_placeholder, bind_text_to_placeholder).
# 0.106.0: Validate binding targets at workflow build time - fixes #956.
# 0.105.0: Add join_output_text helper for ergonomic join.all output pointer construction - fixes #955.
# 0.104.0: Add to_placeholder binding support for ergonomic prompt injection - fixes #953.
# 0.103.3: Add polling helper + testing utilities for streaming.
# 0.103.2: Expand SDK test coverage (customers/stream timeouts).
# 0.103.1: Fix LLM_USER_MESSAGE_TEXT binding pointer (remove /request prefix) - fixes #942.
# 0.103.0: Add add_item() convenience method to MapReduceBuilder.
# 0.102.0: Add workflow pattern helpers (Chain, Parallel, MapReduce) - fixes #934.
version = "2.2.0"
edition = "2021"
description = "Rust SDK for the ModelRelay API"
repository = "https://github.com/modelrelay/modelrelay-rs"
license = "Apache-2.0"
readme = "README.md"
documentation = "https://docs.rs/modelrelay"
keywords = ["llm", "ai", "client", "sdk"]
categories = ["api-bindings"]

[features]
default = ["streaming"]
billing = []
blocking = ["reqwest/blocking"]
streaming = ["reqwest/stream", "dep:futures-util", "dep:futures-core"]
tracing = ["dep:tracing"]
mock = []

[build-dependencies]
schemars = "0.8"
serde_json = "1"
typify = "0.5"

[dependencies]
chrono = { version = "0.4", features = ["serde"] }
futures = "0.3"
futures-core = { version = "0.3", optional = true }
futures-util = { version = "0.3", optional = true }
fastrand = "2"
hex = "0.4"
regress = "0.10"
regex = "1"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
schemars = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
json-patch = "4.1.0"
thiserror = "2"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tracing = { version = "0.1", default-features = true, optional = true }
urlencoding = "2"
uuid = { version = "1", features = ["serde", "v4"] }

[dev-dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
wiremock = "0.6"
futures-util = "0.3"