# `ReqManagedAgents.Providers.ClaudeManagedAgents`
[🔗](https://github.com/cash-mckeeman/req_managed_agents/blob/v0.12.0/req_managed_agents/lib/req_managed_agents/providers/claude_managed_agents.ex#L1)

`ReqManagedAgents.Provider` for the Anthropic Managed Agents backend — `:streaming` mode.
A long-lived SSE stream pushes events; the client POSTs events to drive it; a turn ends on
`session.status_idle`. Resume POSTs a `user.custom_tool_result` event (no echo — the session
already holds the tool call). Composes `Client`, `Stream`, `Event`.

`normalize/1` keys off the most recent status event. `events`, `text`, and `server_tool_uses`
reflect exactly the events passed in (a partial list yields a partial view).

A `budget:` opt (a `ReqManagedAgents.Budget` or a map with its keys) caps a fresh session's
list-priced spend. The provider enforces it between model requests, so a session can
overshoot by its in-flight requests. The budget is sent on create and the session opens only if
the response echoes it back; see `ReqManagedAgents.Budget`. It cannot be combined with
`:session_id`.

A `model_config: %{api_key:, base_url:}` opt builds the client when no `:client` is injected — the canonical way to run a session on a granted key + routed base_url.

# `normalize_model_id`

```elixir
@spec normalize_model_id(String.t()) :: String.t()
```

The CMA endpoint requires bare model ids; strip a leading `provider:` qualifier.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
