Class: SavvyOpenrouter::Resources::ApiKeys

Inherits:
Base
  • Object
show all
Defined in:
lib/savvy_openrouter/resources/api_keys.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SavvyOpenrouter::Resources::Base

Instance Method Details

#create(**body) ⇒ Object



16
17
18
# File 'lib/savvy_openrouter/resources/api_keys.rb', line 16

def create(**body)
  conn.post("/keys", body: body, success: [201])
end

#currentObject



8
9
10
# File 'lib/savvy_openrouter/resources/api_keys.rb', line 8

def current
  conn.get("/key")
end

#delete(hash) ⇒ Object



28
29
30
# File 'lib/savvy_openrouter/resources/api_keys.rb', line 28

def delete(hash)
  conn.delete("/keys/#{hash}")
end

#get(hash) ⇒ Object



20
21
22
# File 'lib/savvy_openrouter/resources/api_keys.rb', line 20

def get(hash)
  conn.get("/keys/#{hash}")
end

#list(**params) ⇒ Object



12
13
14
# File 'lib/savvy_openrouter/resources/api_keys.rb', line 12

def list(**params)
  conn.get("/keys", params: params)
end

#update(hash, **body) ⇒ Object



24
25
26
# File 'lib/savvy_openrouter/resources/api_keys.rb', line 24

def update(hash, **body)
  conn.patch("/keys/#{hash}", body: body)
end