For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • API Reference
      • GETGet models summary
      • POSTFilter models summary
      • GETList models with filters
      • POSTFilter models
      • GETList public model catalog
      • GETList models
      • POSTCreate or update a custom model
      • GETRetrieve a model
      • PATCHUpdate a custom model
      • DELDelete a custom model
      • GETList custom providers
      • POSTCreate a custom provider
      • GETRetrieve a custom provider
      • PATCHUpdate a custom provider
      • DELDelete a custom provider
      • PUTReplace a custom model
      • PUTReplace a custom provider
  • Reference
    • Filters API Reference
LogoLogo
DiscordPlatform
API ReferenceModels

Create or update a custom model

POST
https://api.respan.ai/api/models/
POST
/api/models/
$curl -X POST https://api.respan.ai/api/models/ \
> -H "Authorization: Bearer sk_live_xxxxx" \
> -H "Content-Type: application/json" \
> -d '{
> "model_name": "enterprise-gpt-4-custom"
>}'
1{
2 "id": "enterprise-gpt-4-custom",
3 "model_name": "enterprise-gpt-4-custom",
4 "display_name": "Enterprise GPT-4 Custom",
5 "base_model_name": "gpt-4o",
6 "affiliation_category": "custom",
7 "is_called_by_custom_name": false,
8 "input_cost": 3,
9 "output_cost": 12,
10 "cache_hit_input_cost": 0.75,
11 "cache_creation_input_cost": 4,
12 "max_context_window": 131072,
13 "streaming_support": 1,
14 "function_call": 1,
15 "image_support": 1,
16 "source": "db",
17 "model_type": "chat",
18 "supported_params": {},
19 "throughput": {
20 "average_tps": 2.3,
21 "average_ttft": 0.85,
22 "average_latency": 1.2,
23 "number_of_requests": 1500
24 },
25 "provider": {
26 "id": "enterprise-vllm",
27 "provider_id": "enterprise-vllm",
28 "provider_name": "Enterprise vLLM Server",
29 "extra_kwargs": {
30 "base_url": "https://enterprise-vllm.example.com/api/v1"
31 },
32 "created_at": "2024-05-01T08:00:00Z",
33 "updated_at": "2024-06-10T12:00:00Z"
34 },
35 "created_at": "2024-05-01T08:00:00Z",
36 "updated_at": "2024-06-10T12:00:00Z"
37}

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.

Was this page helpful?
Previous

Retrieve a model

Next
Built with

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY for API key auth or Bearer <JWT> for dashboard auth.

Request

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

Human-readable display name.

custom_provider_idstringOptional
Custom provider string ID or provider identifier to associate.
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.
streaming_supportenumOptional
Allowed values:
function_callenumOptional
Allowed values:
image_supportenumOptional
Allowed values:
supported_params_overridemap from strings to anyOptional

Partial override for model parameter support. The response returns computed supported_params.

Response

Updated existing model.
idstring

Model string ID. Same value as model_name.

model_namestring
Model name used in API calls.
display_namestring

Human-readable model name.

base_model_namestring
Base model inherited from, when configured.
affiliation_categoryenum

Whether the model is built in or organization-specific.

Allowed values:
is_called_by_custom_nameboolean
Whether requests are sent upstream using this custom model name.
input_costdouble
Cost per 1M input tokens in USD.
output_costdouble
Cost per 1M output tokens in USD.
cache_hit_input_costdouble
Cost per 1M cached input tokens in USD.
cache_creation_input_costdouble
Cost per 1M cache creation input tokens in USD.
max_context_windowinteger
Maximum context window size.
streaming_supportenum

Streaming support. 0 = no, 1 = yes.

Allowed values:
function_callenum

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

Allowed values:
image_supportenum

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

Allowed values:
sourceenum
Source of the model definition.
Allowed values:
model_typeenum
Model type.
Allowed values:
supported_paramsmap from strings to any

Computed parameter support after applying model-specific overrides.

throughputobject or null
providerobject
created_atdatetime or null
updated_atdatetime or null

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error