Skip to content

llm.api

0.1.9Package record

Minimal LLM Chat Interface

1packages dependsuggested by 1
3.1Kdownloads / year
67.9%test coverage
13/13flavors OK

Overview

About

A minimal-dependency client for Large Language Model chat APIs. Supports 'OpenAI' https://openai.com/, 'Anthropic' 'Claude' https://claude.com/, 'Moonshot' 'Kimi' https://www.moonshot.ai/, 'OpenAI' 'Codex' subscription endpoints, 'Ollama' https://ollama.com/, and other 'OpenAI'-compatible endpoints. Includes an agent loop with tool use and a 'Model Context Protocol' client https://modelcontextprotocol.io/. API design is derived from the 'ellmer' package, reimplemented with only base R, 'curl', 'jsonlite', and 'tinyoauth'.

Changes in 0.1.9
  • New openai_compatible provider: point chat(), agent(), and chat_session() at any OpenAI-compatible gateway (OpenRouter, DeepSeek, corporate proxies). The base URL comes from llm_base() or OPENAI_COMPATIBLE_BASE_URL ("/chat/completions" is appended, so include any /v1 prefix the gateway expects); the key from llm_key(), OPENAI_COMPATIBLE_API_KEY, or OPENAI_API_KEY, and a keyless gateway is fine (no Authorization header is sent). Model ids pass through untouched and are required (no default). A missing base URL or model fails fast with instructions instead of a curl error. Requested in cornball-ai/corteza#149.
  • agent()'s OpenAI-wire request now omits the Authorization header when no key is configured (matching chat()), so keyless gateways don't receive a bare "Bearer " header.
Show all changes in 0.1.9Hide the rest of the changes in 0.1.9
  • The endpoint/key options are renamed to llm.api_base and llm.api_key, matching the sibling API packages (tts.api_base, stt.api_base, xtx.api_base). llm_base() / llm_key() are unchanged. The pre-0.1.8.1 names (llm.api.api_base / llm.api.api_key) are still read as a fallback, with a one-time deprecation warning per session.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 1.4 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK3 OK2026-04-17
Advisories

none known

Documentation

In release 0.1.9
READMEYes · 496 wordsVignettesNoNEWSYes · 100% structured · mentions 0.1.9Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
34
Examples that run
29%8 run in a plain check · 20 never run
Exported functions with examples
82%
Documented parameters
98%
Return-value docs
100%
Help pages citing references
0%

Downloads

3.1K
CRAN downloads in the past year
Rank #11,923 · ~8/day · ~258/mo
Daily download trend is not available in this view yet.
38230 days
92390 days
3.1K1 year
Compare downloads with other packages →
Also on691 r2u3 autocran

Repository

4Stars
1Forks
4Open issues
0Open PRs
0Releases
75Commits
2Commit identities
75 commits · Last activity 2026-10-22 · 0% stars, 30d · Default branch at 0.1.9.14, ahead of CRAN 0.1.9 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
22
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2026-04-26 · 12026-09-07 · 4
PracticesBeta

4 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/cornball-ai/llm.api on 2026-10-21.

Continuous integration (1)
GitHub Actions
Governance and community (1)
Contributing guide
Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen on or before 2026-01-04
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Commits: at least 20 crediting it in the message
From outside contributors
  • Claude Code
    Pull requests: 1 from outside contributors, first on 2026-06-26
Models named in its commits
  • Claude Opus 4.520 commits · Jan 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
4 external dependencies (excludes base and recommended)

Installing llm.api adds 4 packages (3 with compiled code, 2.0 MB of source tarballs). Heaviest: jsonlite 1.0 MB, curl 714 KB, digest 231 KB.

Depends (1)
R >= 3.5.0
LinkingTo (0)
none
Suggests (1)
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (3)
Author, Maintainer since 0.1.1 (2026)
Copyright holder · added in 0.1.3
Copyright holder
API design derived from ellmer
Releases (6)

Pick two releases to compare their code metrics.

  • 0.1.9Latest
    record
    2026-08-04 · current release · diff ↗
  • 0.1.8
    record
    2026-06-26 · diff ↗
  • 0.1.7
    record
    2026-06-26 · diff ↗ ·
    added 7 exports
    anthropic_claude_credentials, chat_claude_oauth, chat_openai_codex, chat_session_openai_codex, claude_oauth_login, openai_codex_credentials, openai_codex_login
  • 0.1.4
    record
    2026-05-25 · diff ↗ ·
    added 2 exports
    prices_snapshot_stale, usage_cost
  • 0.1.3
    record
    2026-05-15 · diff ↗ ·
    added 4 exports
    history_count_tool_calls, history_tool_calls, prices_snapshot_date, provider_default_model
  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.1
    record
    2026-04-16
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2026-04-16
Total releases
6 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 3.5.0
Download size
97 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("llm.api")
Hernandez, T., cornball.ai, & ellmer team. (2026). llm.api: Minimal LLM Chat Interface (Version 0.1.9) [Computer software]. https://doi.org/10.32614/CRAN.package.llm.api

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for llm.api version 0.1.9 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy