# `SuperPi.AI.Providers.HTTP`
[🔗](https://github.com/oleksandr/super-pi-beam/blob/v0.1.0/lib/super_pi/ai/providers/http.ex#L1)

Streams one request to an SSE model API and normalizes the events (`SuperPi.AI.StreamNormalizer`).
Shared by the Anthropic and OpenAI providers.

Returns what `SuperPi.AI.Provider.generate/2` returns, plus `{:retry_after, ms}` for a rate limit
or an overloaded server, which the conversation machine turns into a backoff.

Req's own retry is off. The machine owns retries (backoff, cap, durable state), and a second
layer of retries would repeat a request the first one already counted.

# `stream`

```elixir
@spec stream(atom(), String.t(), String.t(), list(), map(), keyword()) ::
  {:ok, map()} | {:retry_after, non_neg_integer()} | {:error, term()}
```

---

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