grok_api 0.2.0

Rust client library for the Grok AI API (xAI)
Documentation
[package]

name = "grok_api"

version = "0.2.0"

edition = "2024"

rust-version = "1.85"

authors = ["john mcconnell <john.microtech@gmail.com>"]

license = "MIT OR Apache-2.0"

description = "Rust client library for the Grok AI API (xAI)"

homepage = "https://github.com/micro-tech/grok-api"

repository = "https://github.com/micro-tech/grok-api"

documentation = "https://docs.rs/grok_api"

readme = "README.md"

keywords = ["grok", "ai", "xai", "llm", "api"]

categories = ["api-bindings", "web-programming::http-client"]



[dependencies]

# HTTP client

reqwest = { version = "0.13", features = ["json"] }

tokio = { version = "1.53.1", features = ["full"] }



# Serialization

serde = { version = "1", features = ["derive"] }

serde_json = "1"



# Error handling

anyhow = "1"

thiserror = "2"



# Logging

tracing = "0.1"



# Utilities

rand = "0.10"

dirs = "6"



# Real-time Voice (WebSocket)

tokio-tungstenite = { version = "0.26", features = ["rustls-tls-native-roots"] }

futures-util = "0.3"



[dev-dependencies]

tokio-test = "0.4"

mockito = "1.7"

tracing-subscriber = "0.3"



[features]

default = ["retry"]

retry = []          # Enable automatic retry logic for network errors

starlink = []       # Optimize for Starlink satellite connections



[[example]]

name = "simple_chat"

path = "examples/simple_chat.rs"



[[example]]

name = "conversation"

path = "examples/conversation.rs"



[[example]]

name = "reasoning"

path = "examples/reasoning.rs"



[[example]]

name = "voice_chat"

path = "examples/voice_chat.rs"



[package.metadata.docs.rs]

all-features = true

rustdoc-args = ["--cfg", "docsrs"]