Module: RubyLLM::Pollinations::Provider::Account

Included in:
Pollinations
Defined in:
lib/ruby_llm/pollinations/provider/account.rb

Instance Method Summary collapse

Instance Method Details

#balance ⇒ Object



12
13
14
15
# File 'lib/ruby_llm/pollinations/provider/account.rb', line 12

def balance
  response = @connection.get('account/balance')
  { balance: response.body['balance'] }
end

#key_info ⇒ Object



33
34
35
36
# File 'lib/ruby_llm/pollinations/provider/account.rb', line 33

def key_info
  response = @connection.get('account/key')
  normalize_key_info(response.body)
end

#profile ⇒ Object



7
8
9
10
# File 'lib/ruby_llm/pollinations/provider/account.rb', line 7

def profile
  response = @connection.get('account/profile')
  normalize_profile(response.body)
end

#usage(format: :json, limit: 100, before: nil) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/ruby_llm/pollinations/provider/account.rb', line 17

def usage(format: :json, limit: 100, before: nil)
  response = @connection.get('account/usage') do |req|
    req.params[:format] = format.to_s
    req.params[:limit] = limit
    req.params[:before] = before if before
  end
  normalize_usage(response.body, format)
end

#usage_daily(format: :json) ⇒ Object



26
27
28
29
30
31
# File 'lib/ruby_llm/pollinations/provider/account.rb', line 26

def usage_daily(format: :json)
  response = @connection.get('account/usage/daily') do |req|
    req.params[:format] = format.to_s
  end
  normalize_usage(response.body, format)
end