# `Perplexed.Config`
[🔗](https://github.com/agoodway/perplexed/blob/v0.2.0/lib/perplexed/config.ex#L1)

Perplexed's settings.

A host passes them when it starts Perplexed, `{Perplexed, settings}` in its
supervision tree; they are kept in `:persistent_term`. A setting not given
there falls back to `config :perplexed`, so a standalone project can use
ordinary application config.

| Key                      | Used by                                      |
| ------------------------ | -------------------------------------------- |
| `:model`                 | `Perplexed.answer/2` default model           |
| `:provider`              | Default search provider spec                 |
| `:ladder`                | Default scrape ladder                        |
| `:prices`                | Search price overrides, by provider spec     |
| `:cloudflare_account_id` | Cloudflare search, Browser Run               |
| `:cloudflare_api_token`  | Cloudflare search, Browser Run               |
| `:cloudflare_gateway_id` | Cloudflare search (default `"default"`)      |
| `:deepseek_api_key`      | DeepSeek search and scrape                   |
| `:firecrawl_api_key`     | Firecrawl search and scrape                  |
| `:firecrawl_credit_usd`  | Firecrawl cost per credit (your plan)        |
| `:firecrawl_pdf`         | Let Firecrawl read PDFs the ladder could not |
| `:searxng_instances`     | SearXNG search: base URLs, or `:auto`        |
| `:searxng_discovery`     | `:auto` discovery filters (`countries:`)     |
| `:searxng_refresh_ms`    | `:auto` refresh interval (default daily)     |
| `:pdf_converter`         | `Perplexed.PdfConverter` implementation      |
| `:url_validator`         | `Perplexed.UrlGuard` override                |

# `all`

```elixir
@spec all() :: keyword()
```

The started settings.

# `credential`

```elixir
@spec credential(atom(), atom(), keyword()) ::
  {:ok, String.t()} | {:error, {:authentication, map()}}
```

A credential for `provider`: the call's `opts[:credentials][key]` when
given, else the setting. `{:ok, value}`, or an `:authentication` error
naming the missing key when it is unset or blank.

# `credentials?`

```elixir
@spec credentials?(atom() | [atom()], atom(), keyword()) :: boolean()
```

Whether every key in `keys` has a credential for `provider` (see `credential/3`).

# `get`

```elixir
@spec get(atom(), term()) :: term()
```

The setting for `key`, or `default` when unset.

---

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