{
  "_id": "6ac38740285e8e46a0843b8b",
  "Package": "nrouter",
  "Type": "Package",
  "Title": "OpenAI-Compatible SDK for the nRouter LLM Gateway",
  "Version": "3.0.0",
  "Authors@R": "person(\"nRouter\", email = \"hello@nrouter.ai\", role = c(\"aut\", \"cre\"))",
  "Description": "A client for the nRouter LLM gateway\n(<https://nrouter.ai>), an OpenAI-compatible API giving one key\naccess to models across six provider clouds. No official OpenAI\nSDK exists for R, so this package calls the HTTP API directly\nvia 'httr'. Gateway refusals are raised as classed conditions,\nand per-request cost and token metadata are returned alongside\nevery response.",
  "License": "MIT + file LICENSE",
  "URL": "https://nrouter.ai, https://github.com/nRouterAI/nrouter-sdk",
  "BugReports": "https://github.com/nRouterAI/nrouter-sdk/issues",
  "Encoding": "UTF-8",
  "Config/testthat/edition": "3",
  "Config/roxygen2/version": "8.1.0",
  "Config/pak/sysreqs": "libssl-dev",
  "Repository": "https://nrouterai.r-universe.dev",
  "Date/Publication": "2026-09-05 06:04:48 UTC",
  "RemoteUrl": "https://github.com/nRouterAI/nrouter-sdk",
  "RemoteRef": "HEAD",
  "RemoteSha": "5b62e4b978d59815b853ee34c8b6304007be5502",
  "RemoteSubdir": "sdks/r",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-10-05 11:13:48 UTC",
    "User": "root"
  },
  "Author": "nRouter [aut, cre]",
  "Maintainer": "nRouter <hello@nrouter.ai>",
  "_user": "nrouterai",
  "_type": "src",
  "_file": "nrouter_3.0.0.tar.gz",
  "_fileid": "https://r2.ropensci.org/1e311d7b6878b1661e67628dbfa3f7b8f16651a87bd4b1f07c77e262aa26f176",
  "_filesize": 173595,
  "_sha256": "1e311d7b6878b1661e67628dbfa3f7b8f16651a87bd4b1f07c77e262aa26f176",
  "_expires": "2027-01-13T11:17:18.000Z",
  "_created": "2026-10-05T11:13:48.000Z",
  "_published": "2026-10-05T11:17:20.564Z",
  "_jobs": [
    {
      "job": 111735425041,
      "time": 111,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11340998484"
    },
    {
      "job": 111735424855,
      "time": 128,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11341828718"
    },
    {
      "job": 111735425061,
      "time": 173,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11341574343"
    },
    {
      "job": 111735424775,
      "time": 169,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11341093490"
    },
    {
      "job": 111734515582,
      "time": 153,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11341268166"
    },
    {
      "job": 111735424814,
      "time": 92,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "11341533984"
    },
    {
      "job": 111735425138,
      "time": 73,
      "config": "windows-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11341439150"
    },
    {
      "job": 111735424987,
      "time": 80,
      "config": "windows-oldrel-x86_64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11341443847"
    },
    {
      "job": 111735425050,
      "time": 77,
      "config": "windows-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11341684075"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769",
  "_status": "success",
  "_upstream": "https://github.com/nRouterAI/nrouter-sdk",
  "_commit": {
    "id": "5b62e4b978d59815b853ee34c8b6304007be5502",
    "author": "Rama Surasani <surasani.rama@gmail.com>",
    "committer": "Rama Surasani <surasani.rama@gmail.com>",
    "message": "feat(sdks): error envelopes, log redaction, trace routing and session context (iterations 9-10)\n\n50 files, +3715/-109, completing 100 issues across all 10 SDKs (js, python,\ngo, rust, java, kotlin, android, swift, dart, r):\n\n- Iteration 9 (Issues 401-450):\n  * Standardized gateway error envelope parsing (nested error.code/param/type/message\n    and unnested gateway proxies)\n  * Log-safe credential redaction (masking sk-nrouter-*** and sk-*** tokens across\n    all SDKs to prevent accidental credential leakage in logs and traces)\n  * Diagnostic and human-readable error formatting with sanitized tokens\n  * Android-specific presentation messages (formatUserMessage/formatDiagnosticMessage)\n\n- Iteration 10 (Issues 451-500):\n  * End-to-end trace routing and upstream session context propagation\n  * Configurable traceId and sessionId on all 10 client surfaces with immutable copies\n  * Header injection: x-nr-client-language on all requests, x-nr-client-platform on Android,\n    and x-nr-trace-id / x-nr-session-id\n  * Trace header extraction (extractTraceHeaders) from response metadata and maps\n  * Trace context injection (withTraceContext) for outgoing headers\n  * Strict CRLF injection defense across all languages (including Swift unicodeScalars)\n\nCertified with 15/15 release lanes passing under NROUTER_REQUIRE_ALL=1.\nThis repo is PUBLIC (nRouterAI/nrouter-sdk) — world-readable, zero secrets.\n",
    "time": 1788588288
  },
  "_maintainer": {
    "name": "nRouter",
    "email": "hello@nrouter.ai"
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "curl",
      "role": "Imports"
    },
    {
      "package": "httr",
      "role": "Imports"
    },
    {
      "package": "jsonlite",
      "role": "Imports"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "webfakes",
      "role": "Suggests"
    }
  ],
  "_owner": "nrouterai",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2026-33",
      "n": 3
    },
    {
      "week": "2026-34",
      "n": 18
    },
    {
      "week": "2026-35",
      "n": 126
    },
    {
      "week": "2026-36",
      "n": 70
    }
  ],
  "_tags": [
    {
      "name": "2.1.0",
      "date": "2026-08-30"
    },
    {
      "name": "2.1.1",
      "date": "2026-08-30"
    },
    {
      "name": "sdks/go/v1.0.0",
      "date": "2026-08-30"
    },
    {
      "name": "sdks/go/v1.0.1",
      "date": "2026-08-30"
    },
    {
      "name": "2.2.1",
      "date": "2026-08-31"
    },
    {
      "name": "sdks/go/v2.2.1",
      "date": "2026-08-31"
    },
    {
      "name": "3.0.0",
      "date": "2026-09-05"
    },
    {
      "name": "sdks/go/v3.0.0",
      "date": "2026-09-05"
    },
    {
      "name": "v3.0.0",
      "date": "2026-09-05"
    }
  ],
  "_topics": [
    "ai",
    "ai-gateway",
    "anthropic",
    "api-gateway",
    "azure-openai",
    "bedrock",
    "claude",
    "llm",
    "llm-gateway",
    "llmops",
    "openai",
    "python-sdk",
    "qwen",
    "typescript-sdk",
    "vertex-ai"
  ],
  "_stars": 0,
  "_contributors": [
    {
      "user": "rama6636",
      "count": 209,
      "uuid": 18224342
    },
    {
      "user": "diptesh2006",
      "count": 30,
      "uuid": 177322968
    }
  ],
  "_userbio": {
    "uuid": 317324270,
    "type": "organization",
    "name": "nRouter.ai",
    "followers": 1,
    "description": "Secure enterprise LLM gateway — every model, one API key, with built-in guardrails and budget enforcement.LLM Gateway"
  },
  "_downloads": {
    "count": 0,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/nrouter"
  },
  "_devurl": "https://github.com/nrouterai/nrouter-sdk",
  "_searchresults": 3,
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/manual.pdf",
    "extra/nrouter.html",
    "extra/readme.html",
    "extra/readme.md",
    "LICENSE"
  ],
  "_cranurl": false,
  "_exports": [
    "nrouter_audio_speech",
    "nrouter_audio_transcriptions",
    "nrouter_audio_translations",
    "nrouter_build_sampling_params",
    "nrouter_bytes",
    "nrouter_cache_age_seconds",
    "nrouter_chat",
    "nrouter_chat_completions",
    "nrouter_chat_completions_stream",
    "nrouter_client",
    "nrouter_completions",
    "nrouter_completions_stream",
    "nrouter_compute_jittered_backoff",
    "nrouter_condition",
    "nrouter_configuration_condition",
    "nrouter_count_tokens",
    "nrouter_create_array_store",
    "nrouter_create_memory",
    "nrouter_create_video",
    "nrouter_default_base_url",
    "nrouter_default_connect_timeout_seconds",
    "nrouter_default_stream_idle_seconds",
    "nrouter_default_timeout_seconds",
    "nrouter_download_video_content",
    "nrouter_embeddings",
    "nrouter_env_key",
    "nrouter_error_from_payload",
    "nrouter_extract_trace_headers",
    "nrouter_format_error",
    "nrouter_header_names",
    "nrouter_images_generations",
    "nrouter_is_cache_hit",
    "nrouter_is_cache_miss",
    "nrouter_is_claude_model",
    "nrouter_is_priced",
    "nrouter_is_retryable",
    "nrouter_key_prefix",
    "NROUTER_MAX_RETRY_AFTER_SECONDS",
    "nrouter_messages",
    "nrouter_messages_stream",
    "nrouter_meta",
    "nrouter_model",
    "nrouter_models",
    "nrouter_multipart",
    "nrouter_normalize_anthropic_messages",
    "nrouter_parse_budget_warning",
    "nrouter_parse_gateway_error_envelope",
    "nrouter_parse_retry_after",
    "nrouter_prompt_template",
    "nrouter_prompt_variables",
    "nrouter_redact_keys",
    "nrouter_render_prompt",
    "nrouter_request",
    "nrouter_resolve_api_key",
    "nrouter_responses",
    "nrouter_responses_stream",
    "nrouter_retrieve_video",
    "nrouter_sliding_window",
    "nrouter_sse_parser",
    "nrouter_stream",
    "nrouter_system_variable_conflicts",
    "nrouter_transport_condition",
    "nrouter_uses_messages_wire",
    "nrouter_validate_audio_format",
    "nrouter_validate_gateway_base_url",
    "nrouter_validate_message",
    "nrouter_wait_for_video",
    "nrouter_with_trace_context",
    "nrouter_with_variables",
    "VALID_AUDIO_FORMATS"
  ],
  "_help": [
    {
      "page": "nrouter_audio_speech",
      "title": "POST /audio/speech — generated audio bytes plus response metadata",
      "topics": [
        "nrouter_audio_speech"
      ]
    },
    {
      "page": "nrouter_audio_transcriptions",
      "title": "POST /audio/transcriptions - Whisper-style speech to text",
      "topics": [
        "nrouter_audio_transcriptions"
      ]
    },
    {
      "page": "nrouter_audio_translations",
      "title": "POST /audio/translations - speech in any language to English text",
      "topics": [
        "nrouter_audio_translations"
      ]
    },
    {
      "page": "nrouter_bytes",
      "title": "Raw bytes plus metadata, for the endpoints that do not return JSON",
      "topics": [
        "nrouter_bytes"
      ]
    },
    {
      "page": "nrouter_chat",
      "title": "Send a chat completion request (convenience wrapper)",
      "topics": [
        "nrouter_chat"
      ]
    },
    {
      "page": "nrouter_chat_completions",
      "title": "POST /chat/completions",
      "topics": [
        "nrouter_chat_completions"
      ]
    },
    {
      "page": "nrouter_chat_completions_stream",
      "title": "Stream POST /chat/completions",
      "topics": [
        "nrouter_chat_completions_stream"
      ]
    },
    {
      "page": "nrouter_client",
      "title": "Create an nRouter client",
      "topics": [
        "nrouter_client"
      ]
    },
    {
      "page": "nrouter_completions",
      "title": "POST /completions — the legacy text-completions wire",
      "topics": [
        "nrouter_completions"
      ]
    },
    {
      "page": "nrouter_completions_stream",
      "title": "Stream POST /completions",
      "topics": [
        "nrouter_completions_stream"
      ]
    },
    {
      "page": "nrouter_condition",
      "title": "Build (but do not signal) an nRouter condition",
      "topics": [
        "nrouter_condition"
      ]
    },
    {
      "page": "nrouter_configuration_condition",
      "title": "A configuration failure: the SDK refused before sending anything",
      "topics": [
        "nrouter_configuration_condition"
      ]
    },
    {
      "page": "nrouter_count_tokens",
      "title": "POST /messages/count_tokens — counts input without generating",
      "topics": [
        "nrouter_count_tokens"
      ]
    },
    {
      "page": "nrouter_create_video",
      "title": "POST /videos — starts a video generation job",
      "topics": [
        "nrouter_create_video"
      ]
    },
    {
      "page": "nrouter_default_base_url",
      "title": "The gateway's customer surface",
      "topics": [
        "nrouter_default_base_url"
      ]
    },
    {
      "page": "nrouter_default_connect_timeout_seconds",
      "title": "Connect-phase ceiling, in seconds",
      "topics": [
        "nrouter_default_connect_timeout_seconds"
      ]
    },
    {
      "page": "nrouter_default_stream_idle_seconds",
      "title": "Stall ceiling for streaming and binary transfers, in seconds",
      "topics": [
        "nrouter_default_stream_idle_seconds"
      ]
    },
    {
      "page": "nrouter_default_timeout_seconds",
      "title": "Whole-request ceiling for buffered calls, in seconds",
      "topics": [
        "nrouter_default_timeout_seconds"
      ]
    },
    {
      "page": "nrouter_download_video_content",
      "title": "GET /videos/(id)/content — downloads generated video bytes",
      "topics": [
        "nrouter_download_video_content"
      ]
    },
    {
      "page": "nrouter_embeddings",
      "title": "POST /embeddings",
      "topics": [
        "nrouter_embeddings"
      ]
    },
    {
      "page": "nrouter_env_key",
      "title": "The one environment variable this package reads",
      "topics": [
        "nrouter_env_key"
      ]
    },
    {
      "page": "nrouter_error_from_payload",
      "title": "Pull the gateway's code and message out of an error payload",
      "topics": [
        "nrouter_error_from_payload"
      ]
    },
    {
      "page": "nrouter_header_names",
      "title": "Every response header this SDK reads",
      "topics": [
        "nrouter_header_names"
      ]
    },
    {
      "page": "nrouter_images_generations",
      "title": "POST /images/generations",
      "topics": [
        "nrouter_images_generations"
      ]
    },
    {
      "page": "nrouter_is_priced",
      "title": "Did the gateway price this request exactly?",
      "topics": [
        "nrouter_is_priced"
      ]
    },
    {
      "page": "nrouter_is_retryable",
      "title": "Is this nRouter condition worth retrying?",
      "topics": [
        "nrouter_is_retryable"
      ]
    },
    {
      "page": "nrouter_key_prefix",
      "title": "The prefix every nRouter customer key carries",
      "topics": [
        "nrouter_key_prefix"
      ]
    },
    {
      "page": "nrouter_messages",
      "title": "POST /messages (the Anthropic wire format the gateway also serves)",
      "topics": [
        "nrouter_messages"
      ]
    },
    {
      "page": "nrouter_messages_stream",
      "title": "Stream POST /messages",
      "topics": [
        "nrouter_messages_stream"
      ]
    },
    {
      "page": "nrouter_meta",
      "title": "Per-request metadata from the nRouter response headers",
      "topics": [
        "nrouter_meta"
      ]
    },
    {
      "page": "nrouter_model",
      "title": "GET /models/(model_id)",
      "topics": [
        "nrouter_model"
      ]
    },
    {
      "page": "nrouter_models",
      "title": "GET /models — what this key is allowed to route to",
      "topics": [
        "nrouter_models"
      ]
    },
    {
      "page": "nrouter_multipart",
      "title": "Send a multipart request to the nRouter gateway",
      "topics": [
        "nrouter_multipart"
      ]
    },
    {
      "page": "nrouter_request",
      "title": "Send a request to the nRouter gateway",
      "topics": [
        "nrouter_request"
      ]
    },
    {
      "page": "nrouter_resolve_api_key",
      "title": "Resolve and validate an nRouter API key",
      "topics": [
        "nrouter_resolve_api_key"
      ]
    },
    {
      "page": "nrouter_responses",
      "title": "POST /responses",
      "topics": [
        "nrouter_responses"
      ]
    },
    {
      "page": "nrouter_responses_stream",
      "title": "Stream POST /responses",
      "topics": [
        "nrouter_responses_stream"
      ]
    },
    {
      "page": "nrouter_retrieve_video",
      "title": "GET /videos/(id) — polls a video generation job",
      "topics": [
        "nrouter_retrieve_video"
      ]
    },
    {
      "page": "nrouter_sse_parser",
      "title": "Build an incremental server-sent event parser",
      "topics": [
        "nrouter_sse_parser"
      ]
    },
    {
      "page": "nrouter_stream",
      "title": "Stream a JSON request from the nRouter gateway",
      "topics": [
        "nrouter_stream"
      ]
    },
    {
      "page": "nrouter_transport_condition",
      "title": "A transport failure: the request left this process and got no answer",
      "topics": [
        "nrouter_transport_condition"
      ]
    },
    {
      "page": "nrouter-errors",
      "title": "nRouter error conditions",
      "topics": [
        "nrouter-errors"
      ]
    },
    {
      "page": "print.nrouter_client",
      "title": "Print an nRouter client without disclosing its key",
      "topics": [
        "print.nrouter_client"
      ]
    }
  ],
  "_readme": "https://github.com/nRouterAI/nrouter-sdk/raw/HEAD/sdks/r/README.md",
  "_rundeps": [
    "askpass",
    "curl",
    "httr",
    "jsonlite",
    "mime",
    "openssl",
    "R6",
    "sys"
  ],
  "_score": 2.3010299956639813,
  "_indexed": true,
  "_nocasepkg": "nrouter",
  "_universes": [
    "nrouterai"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "3.0.0",
      "date": "2026-10-05T11:15:37.000Z",
      "distro": "resolute",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/abd42a599ca1a347c75cb4c725933cb35b5e4d4a1247f3f6cc593f866ecfd0d2",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "3.0.0",
      "date": "2026-10-05T11:15:52.000Z",
      "distro": "resolute",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/4bca6f09d8612fb8eb059ba3ffd60d9854b8762ad0c8cb0c465c0a4f3e569fc9",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "3.0.0",
      "date": "2026-10-05T11:16:15.000Z",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/76c74df71405ca7e318ccac32b1f376480ab0d660339e5121d27cb36b1b30c59",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "3.0.0",
      "date": "2026-10-05T11:16:03.000Z",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/7cd570996c7a2d4bbc51e2e92c8cd6a5e9e05b1df8a688be2635fca57e2f60cd",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "3.0.0",
      "date": "2026-10-05T11:15:33.000Z",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/fe1bd0c14b181bafefdf9a055a739cb20bb617b3b8b837413a6e170608494daf",
      "status": "success",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "3.0.0",
      "date": "2026-10-05T11:14:50.000Z",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/c52873183fce0fecab90145a25f5c6e24d148b0c8772accf3fef2951392df4ba",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "3.0.0",
      "date": "2026-10-05T11:14:58.000Z",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/4c0cd05efa11d0afebda13b2c048fb4b7fe01171508f77f6269dcdd67b70933e",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "3.0.0",
      "date": "2026-10-05T11:14:55.000Z",
      "commit": "5b62e4b978d59815b853ee34c8b6304007be5502",
      "fileid": "https://r2.ropensci.org/74715e7e3160e2862dc4cab11d0161c2b3db6fb924bdf5cda23e554c5e2e3adc",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/nrouterai/actions/runs/37301303769"
    }
  ]
}