E2bEx.Client (E2bEx v0.1.0)

Copy Markdown View Source

Holds connection configuration for the E2B API.

Build one with E2bEx.client/1 (or E2bEx.Client.new/1) and pass it as the first argument to every resource function.

Summary

Functions

Build a client.

Types

t()

@type t() :: %E2bEx.Client{
  api_key: String.t(),
  base_url: String.t(),
  req_options: keyword()
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()

Build a client.

Options

  • :api_key (required) — E2B API key sent as the X-API-Key header.
  • :base_url — defaults to https://api.e2b.app.
  • :req_options — extra options merged into every Req request (e.g. a :plug for testing, or :retry/:receive_timeout).

Falls back to Application.get_env(:e2b_ex, key) for any option not given.

Req's automatic retries are disabled by default; pass req_options: [retry: :safe_transient] to re-enable them.