# `Buble`
[🔗](https://github.com/bublehq/sdks/blob/main/lib/buble.ex#L1)

Server-side Elixir SDK for the Buble public API.

[Buble](https://buble.ai/) provides AI chat, image generation, video
generation, file uploads, and preconfigured AI app workflows. The
[Buble API documentation](https://buble.ai/docs) describes authentication,
model discovery, file uploads, asynchronous generation tasks, app workflows,
polling, and chat model endpoints.

## Quick start

    client = Buble.Client.new!(api_key: "sk_...")

    {:ok, task} =
      Buble.Generations.create(client, %{
        model: "nano-banana",
        prompt: "A cinematic studio product photo"
      })

    {:ok, result} = Buble.Generations.wait(client, task["data"]["id"])

The SDK also reads `BUBLE_API_KEY` and `BUBLE_BASE_URL` from the environment
when omitted.

# `client`

```elixir
@spec client(keyword()) :: {:ok, Buble.Client.t()} | {:error, Buble.Error.t()}
```

Creates a `Buble.Client`.

# `client!`

```elixir
@spec client!(keyword()) :: Buble.Client.t()
```

Creates a `Buble.Client` or raises `Buble.Error`.

---

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