claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// Frameworks & SDKs

anthropix

Unofficial Anthropic API client for Elixir. Integrate Claude, Anthropic's powerful language model, into your applications.

// Frameworks & SDKs[ api ][ claude ]#claude#ai#anthropic#api-client#claude-ai#elixir#llms#frameworksApache-2.0$open-sourceupdated 15 days ago
Dormant
0/100
last commit about 1 year ago
last release none
releases 0
open issues 1
// install
git clone https://github.com/aaronrussell/anthropix

Anthropix

Anthropix

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.

  • ✅ API client fully implementing the Anthropic API
  • 🧰 Tool use (function calling)
  • 🧠 Extended thinking
  • ⚡ Prompt caching
  • 📦 Message batching
  • 🛜 Streaming API requests
    • Stream to an Enumerable
    • Or stream messages to any Elixir process

Installation

The package can be installed by adding anthropix to your list of dependencies in mix.exs.

def deps do
  [
    {:anthropix, "~> 0.6"}
  ]
end

Quickstart

[!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.

client = Anthropix.init(beta: ["output-128k-2025-02-19"])

For more examples, refer to the Anthropix documentation.

Initiate a client.

See Anthropix.init/2.

client = Anthropix.init(api_key)

Chat with Claude

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."
# }], ...}}

Streaming

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.

License

This package is open source and released under the Apache-2 License.

© Copyright 2024 Push Code Ltd.

// compatibility

Platformsapi
Operating systems
AI compatibilityclaude
LicenseApache-2.0
Pricingopen-source
LanguageElixir

// faq

What is anthropix?

Unofficial Anthropic API client for Elixir. Integrate Claude, Anthropic's powerful language model, into your applications.. It is open-source on GitHub.

Is anthropix free to use?

anthropix is open-source under the Apache-2.0 license, so it is free to use.

What category does anthropix belong to?

anthropix is listed under other in the Claudeers registry of Claude-compatible tools.

0 views
54 stars
unclaimed
updated 15 days ago

// embed badge

anthropix on Claudeers
[![Claudeers](https://claudeers.com/api/badge/anthropix.svg)](https://claudeers.com/anthropix)

// retro hit counter

anthropix hit counter
[![Hits](https://claudeers.com/api/counter/anthropix.svg)](https://claudeers.com/anthropix)

// reviews

// guestbook

0/500

// related in Frameworks & SDKs

🔓

An open-source AI coding agent that lives in your terminal.

// frameworksQwenLM/TypeScript25,830Apache-2.0[ claude ]
🔓

Claude Code 泄露源码 - 本地可运行版本,新增跨平台桌面端软件补齐Computer Use(附带核心模块解析)

// frameworksNanmiCoder/TypeScript13,109NOASSERTION[ claude ]
🔓

LangGPT: Empowering everyone to become a prompt expert! 🚀 📌 结构化提示词(Structured Prompt)提出者 📌 元提示词(Meta-Prompt)发起者 📌 最流行的提示词落地范式 | Language of GPT The p…

// frameworkslanggptai/Jupyter Notebook12,304Apache-2.0[ claude ]
🔓

Multi-Agent Harness for Production AI

// frameworksaden-hive/Python10,632Apache-2.0[ claude ]
→ see how anthropix connects across the ecosystem