Generates a User-Agent string for the pager client, including OS and architecture.
// Source: https://github.com/xai-org/grok-build | License: Apache-2.0 | Copyright 2023-2026 SpaceXAI
// Provided via justclaw.it.com; keep this notice with the code.
pub const PAGER_CLIENT_TYPE: &str = "grok-pager";
pub const HEADLESS_CLIENT_TYPE: &str = "grok-shell";
pub const PAGER_CLIENT_VERSION: &str = xai_grok_version::VERSION;
/// `User-Agent` for the pager's own HTTP clients that call `api.x.ai` directly (voice STT).
///
/// Matches the sampler's `grok-shell/<version> (os; arch)` shape so server-side dashboards bucket voice traffic alongside chat / imagine requests.
pub fn client_user_agent() -> String {
format!(
"{}/{} ({}; {})",
HEADLESS_CLIENT_TYPE,
PAGER_CLIENT_VERSION,
std::env::consts::OS,
std::env::consts::ARCH,
)
}
#[cfg(te
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key