Skip to navigation

Create or update a custom model

Create an organization-specific custom model. If a model with the same model_name already exists in your organization, it is updated and the endpoint returns 200.

Authentication

AuthorizationBearer

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

OR
AuthorizationBearer

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

Request

This endpoint expects an object.
model_namestringRequired
Unique model name within your organization.
base_model_namestringOptional
Base model to inherit properties from.
custom_provider_idstringOptional

The custom provider to call the model through. Required unless base_model_name is set, in which case the base model's provider is used.

provider_idstringOptional

Alternative to custom_provider_id.

input_costdoubleOptional
Cost per 1M input tokens in USD.
output_costdoubleOptional
Cost per 1M output tokens in USD.
cache_hit_input_costdoubleOptional
Cost per 1M cached input tokens in USD.
cache_creation_input_costdoubleOptional
Cost per 1M cache creation input tokens in USD.
max_context_windowintegerOptional
Maximum context window size.
function_callenumOptional
Allowed values:
image_supportenumOptional
Allowed values:
supported_params_overridemap from strings to anyOptional

Partial override for the model's parameters: a map of parameter name to a parameter definition with the same shape as supported_params entries (name, type, default, range with min and max, description, required), or null to remove the parameter. Replaces any earlier override. The response returns the computed supported_params.

Response

Updated existing model.
idstring

Model string ID. Same value as model_name.

model_namestring
Model name used in API calls.
base_model_namestringOptional
Base model inherited from, when configured.
affiliation_categoryenumOptional

keywordsai for built-in models, custom for your organization's models.

Allowed values:
is_called_by_custom_namebooleanOptional
Whether requests are sent upstream using this custom model name.
input_costdoubleOptional
Cost per 1M input tokens in USD.
output_costdoubleOptional
Cost per 1M output tokens in USD.
cache_hit_input_costdoubleOptional
Cost per 1M cached input tokens in USD.
cache_creation_input_costdoubleOptional
Cost per 1M cache creation input tokens in USD.
max_context_windowintegerOptional
Maximum context window size.
function_callenumOptional

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

Allowed values:
image_supportenumOptional

Vision input support. 0 = no, 1 = yes.

Allowed values:
model_typeenumOptional
Model type.
Allowed values:
supported_paramsmap from strings to anyOptional

Computed parameter support after applying model-specific overrides.

providerobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error