Skip to main content
POST
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

string
required
Unique model name within your organization. This will be used to reference the model in API calls.
string
Base model to inherit properties from. Can be a global model (e.g., "gpt-4") or another custom model.
string
Human-readable display name for the model.
integer | string
ID or provider_id of the custom provider to associate with this model. See Custom Providers.
integer | string
Alternative to custom_provider_id. Either one can be used.

Pricing

float
Cost per 1M input tokens in USD.
float
Cost per 1M output tokens in USD.
float
Cost per 1M cached input tokens in USD.
float
Cost per 1M cache creation tokens in USD.

Capabilities

integer
Maximum context window size for the model.
integer
Streaming support. 0 for no, 1 for yes.
integer
Function calling support. 0 for no, 1 for yes.
integer
Image/vision support. 0 for no, 1 for yes.
object
Override UI parameter support for this model in the Playground. See the model detail endpoint for current values.

Response

Returns the created or updated model object.