# `OpenrouterSdk.Auth`
[🔗](https://github.com/zmzlois/openrouter_sdk/blob/v0.1.0/lib/openrouter_sdk/auth.ex#L1)

build the headers that authenticate a request.

the api key may come from `%Config{}` or be overridden per call (the
oauth flow returns a per-user key — consumers pass it via opts).

# `headers`

```elixir
@spec headers(OpenrouterSdk.Config.t()) ::
  {:ok, [{String.t(), String.t()}]} | {:error, OpenrouterSdk.Error.t()}
```

produce the request headers for an authenticated call. returns
`{:ok, headers}` or `{:error, %Error{}}` if no api key is available.

---

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