# alloy v0.10.1 - API Reference

## Modules

- [Alloy.Provider.OpenAIStream](Alloy.Provider.OpenAIStream.md): Shared OpenAI-format SSE stream parser.
- [Alloy.Provider.SSE](Alloy.Provider.SSE.md): Shared SSE (Server-Sent Events) framing utilities.

- Core
  - [Alloy](Alloy.md): Model-agnostic agent harness for Elixir.
  - [Alloy.Agent.Config](Alloy.Agent.Config.md): Configuration for an agent run.
  - [Alloy.Agent.Events](Alloy.Agent.Events.md): Event envelope construction and runtime opts normalization.
  - [Alloy.Agent.Server](Alloy.Agent.Server.md): OTP-backed persistent agent process.
  - [Alloy.Agent.State](Alloy.Agent.State.md): Mutable state for an agent run.
  - [Alloy.Agent.Turn](Alloy.Agent.Turn.md): The core agent loop.
  - [Alloy.Message](Alloy.Message.md): Normalized message struct used throughout Alloy.
  - [Alloy.ModelMetadata](Alloy.ModelMetadata.md): Provider model metadata used for context budgeting.
  - [Alloy.Result](Alloy.Result.md): Structured result from an agent run.
  - [Alloy.Session](Alloy.Session.md): Serializable session container.
  - [Alloy.Usage](Alloy.Usage.md): Token usage tracking across turns.

- Providers
  - [Alloy.Provider](Alloy.Provider.md): Behaviour for LLM providers.
  - [Alloy.Provider.Anthropic](Alloy.Provider.Anthropic.md): Provider for Anthropic's Claude Messages API.
  - [Alloy.Provider.Codex](Alloy.Provider.Codex.md): Provider for ChatGPT-plan-backed Codex execution via `codex exec`.
  - [Alloy.Provider.Gemini](Alloy.Provider.Gemini.md): Provider for Google's Gemini GenerateContent API.
  - [Alloy.Provider.OpenAI](Alloy.Provider.OpenAI.md): Provider for OpenAI's Responses API.
  - [Alloy.Provider.OpenAICompat](Alloy.Provider.OpenAICompat.md): Generic OpenAI-compatible provider.
  - [Alloy.Provider.Retry](Alloy.Provider.Retry.md): Provider retry, backoff, fallback, and streaming dispatch logic.
  - [Alloy.Provider.Test](Alloy.Provider.Test.md): A scripted test provider that returns pre-configured responses in order.
  - [Alloy.Provider.XAI](Alloy.Provider.XAI.md): Provider for xAI's Grok models.

- Tools
  - [Alloy.Tool](Alloy.Tool.md): Behaviour for tools that agents can call.
  - [Alloy.Tool.Core.Bash](Alloy.Tool.Core.Bash.md): Built-in tool: execute shell commands via `bash -rc` (restricted shell).
  - [Alloy.Tool.Core.Edit](Alloy.Tool.Core.Edit.md): Built-in tool: search-and-replace edits on files.
  - [Alloy.Tool.Core.Read](Alloy.Tool.Core.Read.md): Built-in tool: read files with line numbers.
  - [Alloy.Tool.Core.Write](Alloy.Tool.Core.Write.md): Built-in tool: write files, creating parent directories as needed.
  - [Alloy.Tool.Executor](Alloy.Tool.Executor.md): Executes tool calls and returns result messages.
  - [Alloy.Tool.Registry](Alloy.Tool.Registry.md): Builds tool schemas and function maps from tool modules.

- Context
  - [Alloy.Context.Compactor](Alloy.Context.Compactor.md): Summary-based context compaction.

- Middleware
  - [Alloy.Middleware](Alloy.Middleware.md): Behaviour for middleware that wraps the agent loop.

- Testing
  - [Alloy.Testing](Alloy.Testing.md): ExUnit helpers for testing agents built with Alloy.

