Retrieve a custom model

Retrieve a model by name. Global models are accessible by anyone. Custom models are only accessible by the owning organization.

Path parameters

model_namestringRequired

The model’s unique name. Can include slashes (e.g., openai/gpt-4).

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Response

Model details.
idstring
Model ID.
model_namestring
Unique model name.
display_namestring
Display name.
base_model_namestring
Base model inherited from.
affiliation_categoryenum
Model type.
Allowed values:
input_costdouble

Cost per 1M input tokens (USD).

output_costdouble

Cost per 1M output tokens (USD).

cache_hit_input_costdouble

Cost per 1M cached input tokens (USD).

cache_creation_input_costdouble

Cost per 1M cache creation tokens (USD).

max_context_windowinteger
Maximum context window size.
streaming_supportinteger

Streaming support. 0 = no, 1 = yes.

function_callinteger

Function calling support. 0 = no, 1 = yes.

image_supportinteger

Image/vision support. 0 = no, 1 = yes.

sourceenum
Model source.
Allowed values:
providerobject
Associated provider.

Errors

401
Unauthorized Error
404
Not Found Error