Ana içeriğe geç

Create Model Catalog Entry

Endpoint

POST /apiops/projects/{projectName}/llm-models/{modelName}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
modelNamestringYesModel catalog entry name (must match the name in the body, case-insensitive)

Query Parameters

None

Request Body

Full JSON Body Example

{
"name": "openai/gpt-5-mini",
"providerDefinitionId": "6640aa12c2e4b8000000ef01",
"providerCode": "openai",
"modelId": "gpt-5-mini",
"displayName": "GPT-5 Mini",
"contextWindow": 128000,
"maxOutputTokens": 16384,
"pricePerMillionInput": 0.25,
"pricePerMillionOutput": 2.00,
"pricePerMillionCached": 0.025,
"pricePerImage": null,
"pricePerAudioMinute": null,
"pricePerCharacterTts": null,
"capabilities": ["chat", "function_calling", "json_mode"],
"modality": "TEXT",
"isDeprecated": false,
"deprecatedAt": null,
"sunsetAt": null,
"builtIn": false
}

Request Body Fields

FieldTypeRequiredDefaultDescription
namestringYes-Catalog name in \{providerCode\}/\{modelId\} form; must match the modelName path parameter
providerDefinitionIdstringNo-Reference to the owning LLM provider definition
providerCodestringYes-Provider code (e.g. openai, anthropic). Required for custom entries
modelIdstringYes-Provider-facing model identifier (e.g. gpt-5-mini). Required for custom entries
displayNamestringNo-Human-readable label
contextWindowintegerNo-Context window size in tokens
maxOutputTokensintegerNo-Maximum output tokens; omit to use the provider default
pricePerMillionInputnumberNo-USD per 1M input tokens
pricePerMillionOutputnumberNo-USD per 1M output tokens
pricePerMillionCachednumberNo-USD per 1M cached input tokens
pricePerImagenumberNo-USD per generated image
pricePerAudioMinutenumberNo-USD per minute of audio (STT)
pricePerCharacterTtsnumberNo-USD per input character (TTS)
capabilitiesarray[string]No-Capability tags (e.g. chat, function_calling, vision, embedding, json_mode, reasoning)
modalitystringNo-Model modality: TEXT, VISION, AUDIO, EMBEDDING, RERANK, MULTIMODAL, IMAGE
isDeprecatedbooleanNofalseWhether the model is deprecated
deprecatedAtstringNo-Deprecation announcement time (ISO-8601)
sunsetAtstringNo-Planned removal time (ISO-8601)
builtInbooleanNofalseLeave false for custom entries. See the built-in note below.

Notes

  • Upsert: If an entry with the same name already exists in the project, it is updated in place (the existing id is reused). Otherwise a new entry is created.
  • Name match: modelName in the path must equal the name in the body (case-insensitive), or a 400 is returned.
  • providerCode + modelId required: For custom entries (builtIn=false) both are mandatory.
  • id / projectId are server-managed: Any id or projectId in the body is ignored — the entry is always scoped to the path project.
  • Built-in entries (builtIn=true): Only the price fields (pricePerMillionInput/Output/Cached, pricePerImage, pricePerAudioMinute, pricePerCharacterTts) are applied; all other fields are preserved from the seed. The referenced entry must actually be a persisted built-in, and its id is required.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"deploymentResult": {
"success": true
}
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
deploymentResultobjectResult of the save operation
deploymentResult.successbooleanWhether the operation completed successfully

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Model catalog entry name in path (openai/gpt-5-mini) does not match name in body (openai/gpt-5)!"
}

or

{
"status": "FAILURE",
"resultMessage": "providerCode and modelId are required"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/llm-models/openai%2Fgpt-5-mini/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "openai/gpt-5-mini",
"providerCode": "openai",
"modelId": "gpt-5-mini",
"displayName": "GPT-5 Mini",
"contextWindow": 128000,
"maxOutputTokens": 16384,
"pricePerMillionInput": 0.25,
"pricePerMillionOutput": 2.00,
"pricePerMillionCached": 0.025,
"capabilities": ["chat", "function_calling", "json_mode"],
"modality": "TEXT",
"builtIn": false
}'

Notes and Warnings

  • Upsert behaviour: POST /{modelName}/ both creates and updates. To be explicit about updating an existing entry, use Update Model Catalog Entry (PUT), which requires the entry to already exist.
  • Built-in price-only edit: When builtIn=true, everything except the price fields is ignored and preserved from the shipped seed. Custom fields cannot be forced onto a built-in model this way.
  • Name form: The catalog name uses the {providerCode}/{modelId} format. URL-encode the / as %2F in the path.
  • No secret fields: The catalog carries no @SecretData fields and no _class discriminator — nothing is masked, and there is no secret-preservation-on-blank behaviour to consider.