8000 GitHub - benjreinhart/req_ai: Extensible Elixir client for AI APIs, built on Req, with provider-native formats, streaming, and telemetry. · GitHub
[go: up one dir, main page]

Skip to content
benjreinhartPublic

About

Extensible Elixir client for AI APIs, built on Req, with provider-native formats, streaming, and telemetry.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

61 Commits

Folders and files

Repository files navigation

ReqAI

CI Hex version Hex Docs

ReqAI is an extensible Elixir client for AI APIs, built on Req.

{:ok, %Req.Response{}, %{"output" => [%{"content" => [content]}]}} =
  ReqAI.generate(ReqAI.Provider.OpenAI, 
    model: "gpt-5.4-mini",
    input: "Say hello"
  )

IO.puts(content["text"])

See the Getting Started guide for configuration and usage examples.

Features

  • Generate and stream with one calling convention, using each provider's request and response formats.
  • Built-in adapters for Anthropic, OpenAI, Gemini, OpenRouter, and TypeSafe. Add custom adapters with the Provider behaviour.
  • Telemetry for request lifecycle, duration, token usage, and time to first chunk. Customize metadata with the Telemetry behaviour.
  • Configure authentication, retries, timeouts, and testing through Req.
  • Optional translators for your own request, response, error, and event shapes.

Installation

Add ReqAI to your dependencies in mix.exs:

{:req_ai, ">= 0.0.0"}

Requires Elixir 1.18 or later and Req 0.8.0 or later.

About

Extensible Elixir client for AI APIs, built on Req, with provider-native formats, streaming, and telemetry.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0