# `Jibu.Response`
[🔗](https://github.com/oliverandrich/jibu/blob/v0.2.1/lib/jibu/response.ex#L1)

A Messages API response.

The fields mirror the API's JSON with string keys.
`body` holds the complete decoded body, including fields Jibu does not lift.

# `t`

```elixir
@type t() :: %Jibu.Response{
  body: map(),
  content: [map()],
  id: String.t() | nil,
  model: String.t() | nil,
  stop_reason: String.t() | nil,
  usage: map() | nil
}
```

# `json`

```elixir
@spec json(t()) :: {:ok, term()} | {:error, Jibu.Error.t()}
```

Decodes the text of a structured output as JSON.

A refusal returns an error instead of a result.
Output cut off at `max_tokens` or at the context window returns an error, never partial JSON.
See the [structured output guide](structured-output.md).

# `text`

```elixir
@spec text(t()) :: String.t()
```

Returns the text of all `text` blocks, joined without a separator.

---

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