Create a new custom model or update an existing one (upsert by model_name). Custom models allow you to define organization-specific configurations with custom pricing, capabilities, and provider associations.
Upsert behavior: If a model with the same model_name already exists in your organization, it will be updated with the new values.
Request body
-
model_name string required: Unique model name within your organization. This will be used to reference the model in API calls.
Example
-
base_model_name string: Base model to inherit properties from. Can be a global model (e.g., "gpt-4") or another custom model.
Example
-
display_name string: Human-readable display name for the model.
Example
-
custom_provider_id integer | string: ID or provider_id of the custom provider to associate with this model. See Custom Providers.
Example
provider_id integer | string: Alternative to custom_provider_id. Either one can be used.
Pricing
-
input_cost float: Cost per 1M input tokens in USD.
Example
-
output_cost float: Cost per 1M output tokens in USD.
Example
-
cache_hit_input_cost float: Cost per 1M cached input tokens in USD.
-
cache_creation_input_cost float: Cost per 1M cache creation tokens in USD.
Capabilities
-
max_context_window integer: Maximum context window size for the model.
Example
-
streaming_support integer: Streaming support. 0 for no, 1 for yes.
-
function_call integer: Function calling support. 0 for no, 1 for yes.
-
image_support integer: Image/vision support. 0 for no, 1 for yes.
-
supported_params_override object: Override UI parameter support for this model in the Playground. See the model detail endpoint for current values.
Example
Response
Returns the created or updated model object.