# `Arcanum.Gateway`
[🔗](https://github.com/kakilangit/arcanum/blob/v0.1.0/lib/arcanum/gateway.ex#L1)

Single entry point for all inference calls.

Pipeline: auth (credential resolution) → adapter (wire protocol) → normalizer (post-processing).

Callers never touch adapters, profiles, or normalizers directly.

# `chat`

```elixir
@spec chat(map(), Arcanum.Intent.t(), keyword()) ::
  {:ok, Arcanum.Response.t()} | {:error, term()}
```

Synchronous chat completion.
Accepts optional `adapter` override for testing.

# `embed`

```elixir
@spec embed(map(), String.t(), String.t()) :: {:ok, [float()]} | {:error, term()}
```

Generates embeddings.

# `list_models`

```elixir
@spec list_models(map()) :: {:ok, [String.t()]} | {:error, term()}
```

Lists available models from the provider.

Each adapter handles its own endpoint format and filtering internally.

# `stream`

```elixir
@spec stream(map(), Arcanum.Intent.t(), keyword()) ::
  {:ok, Enumerable.t()} | {:error, term()}
```

Streaming chat completion.

Returns a normalized stream. Each delta has content fallback applied.
The caller is responsible for merging deltas; the final merged response
should be passed through `Normalizer.normalize/2` for tool-call extraction.

---

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