ruby/resources/models/methods/retrieve/index.md +0 −58 deleted
File Deleted View Diff
1## Retrieve model
2
3`models.retrieve(model) -> Model`
4
5**get** `/models/{model}`
6
7Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
8
9### Parameters
10
11- `model: String`
12
13### Returns
14
15- `class Model`
16
17 Describes an OpenAI model offering that can be used with the API.
18
19 - `id: String`
20
21 The model identifier, which can be referenced in the API endpoints.
22
23 - `created: Integer`
24
25 The Unix timestamp (in seconds) when the model was created.
26
27 - `object: :model`
28
29 The object type, which is always "model".
30
31 - `:model`
32
33 - `owned_by: String`
34
35 The organization that owns the model.
36
37### Example
38
39```ruby
40require "openai"
41
42openai = OpenAI::Client.new(api_key: "My API Key")
43
44model = openai.models.retrieve("gpt-4o-mini")
45
46puts(model)
47```
48
49#### Response
50
51```json
52{
53 "id": "id",
54 "created": 0,
55 "object": "model",
56 "owned_by": "owned_by"
57}
58```