Retrieve model
models.retrieve(strmodel) -> Model
get /models/{model}
Retrieve model
Parameters
model: str
Returns
-
class Model: …Describes an OpenAI model offering that can be used with the API.
-
id: strThe model identifier, which can be referenced in the API endpoints.
-
created: intThe Unix timestamp (in seconds) when the model was created.
-
object: Literal["model"]The object type, which is always "model".
"model"
-
owned_by: strThe organization that owns the model.
-
Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
model = client.models.retrieve(
"gpt-4o-mini",
)
print(model.id)
Response
{
"id": "id",
"created": 0,
"object": "model",
"owned_by": "owned_by"
}
Example
from openai import OpenAI
client = OpenAI()
client.models.retrieve("VAR_chat_model_id")
Response
{
"id": "VAR_chat_model_id",
"object": "model",
"created": 1686935002,
"owned_by": "openai"
}