A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Unofficial Anthropic API client for Elixir. Integrate Claude, Anthropic's powerful language model, into your application

Anthropix is an open-source Elixir client for the Anthropic API, providing a simple and convenient way to integrate Claude, Anthropic's powerful language model, into your applications.
The package can be installed by adding anthropix to your list of dependencies in mix.exs.
def deps do
[
{:anthropix, "~> 0.6"}
]
end
[!NOTE]
Beta features
Anthropic frequently ship new features under a beta flag, requiring headers to be added to your requests to take advantage of the feature.
If required, beta headers can be added with
init/2.hljs language-elixirclient = Anthropix.init(beta: ["output-128k-2025-02-19"])
For more examples, refer to the Anthropix documentation.
See Anthropix.init/2.
client = Anthropix.init(api_key)
See Anthropix.chat/2.
messages = [
%{role: "user", content: "Why is the sky blue?"},
%{role: "assistant", content: "Due to rayleigh scattering."},
%{role: "user", content: "How is that different than mie scattering?"},
]
Anthropix.chat(client, [
model: "claude-3-opus-20240229",
messages: messages,
])
# {:ok, %{"content" => [%{
# "type" => "text",
# "text" => "Mie scattering affects all wavelengths similarly, while Rayleigh favors shorter ones."
# }], ...}}
A streaming request can be initiated by setting the :stream option.
When :stream is true a lazy t:Enumerable.t/0 is returned which can be used with any Stream functions.
{:ok, stream} = Anthropix.chat(client, [
model: "claude-3-opus-20240229",
messages: messages,
stream: true,
])
# {:ok, #Function<52.53678557/2 in Stream.resource/3>}
stream
|> Stream.each(&update_ui_with_chunk/1)
|> Stream.run()
# :ok
Because the above approach builds the t:Enumerable.t/0 by calling receive, using this approach inside GenServer callbacks may cause the GenServer to misbehave. Setting the :stream option to a t:pid/0 returns a t:Task.t/0 which will send messages to the specified process.
This package is open source and released under the Apache-2 License.
© Copyright 2024 Push Code Ltd.
npx CLI installing 100+ agents, commands, hooks, and integrations in one command
干净、强大、属于你的 AI Agent 平台 --AI agents, without the clutter.
Native macOS app to monitor Claude AI usage limits and watch your coding sessions live
An AI-powered custom node for ComfyUI designed to enhance workflow automation and provide intelligent assistance