> For the complete documentation index, see [llms.txt](https://docs.autonomi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autonomi.com/developers/sdk/install/reference/language-bindings/ruby.md).

# Ruby

The Ruby SDK talks to `antd` over REST by default and also includes a gRPC client.

## Install

```bash
gem install antd
```

## Connect to the daemon

```ruby
require "antd"

client = Antd::Client.new(base_url: "http://localhost:8082")
health = client.health
puts health.network
```

## Store and retrieve data

```ruby
require "antd"

client = Antd::Client.new
result = client.data_put_public("Hello, Autonomi!")
puts result.address

data = client.data_get_public(result.address)
puts data
```

## Type mappings

| Autonomi type  | Ruby type                              |
| -------------- | -------------------------------------- |
| `HealthStatus` | model object with `ok` and `network`   |
| `PutResult`    | model object with `cost` and `address` |
| Raw data       | `String`                               |

## Error handling

```ruby
begin
  client.data_get_public("bad-address")
rescue Antd::NotFoundError
  puts "Data not found"
rescue Antd::PaymentError
  puts "Insufficient funds"
rescue Antd::AntdError => e
  puts e.message
end
```

## Full API reference

For all available daemon endpoints, see the [REST API](/developers/sdk/install/reference/rest-api.md).
