Ana içeriğe geç

Update LLM Provider Definition

Endpoint

PUT /apiops/projects/{projectName}/llm-provider-definitions/{definitionName}/

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
definitionNamestringYesProvider catalog definition name (the definition must already exist and must not be built-in)

Query Parameters

None

Request Body

The body is an LlmProviderDefinition object — a plain entity, not a polymorphic type, so no _class discriminator is required or accepted.

Full JSON Body Example

{
"name": "internal-llm-gateway",
"code": "internal-llm-gateway",
"displayName": "Internal LLM Gateway (v2 rollout)",
"defaultEndpoint": "https://llm-gateway-v2.internal.example.com/v1",
"defaultApiVersion": "v1",
"defaultAuthScheme": "API_KEY_HEADER",
"defaultAuthHeaderName": "x-api-key",
"iconUrl": "https://cdn.example.com/icons/internal-llm.svg",
"docsUrl": "https://wiki.internal.example.com/llm-gateway"
}

Request Body Fields

FieldTypeRequiredDefaultDescription
namestringNocode value, then path valueDefinition name; if blank, falls back to code, then to definitionName. Must match definitionName in the path (case-insensitive) once resolved
codestringNo-Provider type code
displayNamestringNo-UI label
defaultEndpointstringNo-Default base API URL
defaultApiVersionstringNo-Default API version
defaultAuthSchemestringNo-Default auth scheme enum constant (BEARER, API_KEY_HEADER, BASIC, AWS_SIGV4, OAUTH2, NONE, CUSTOM)
defaultAuthHeaderNamestringNo-Default credential header name
iconUrlstringNo-Provider icon URL
docsUrlstringNo-Vendor documentation deep link
builtInbooleanNoforced falseIgnored on write and always persisted as false. Sending "builtIn": true is rejected outright (see below)
id, projectId, lastUpdatedAtNoserver-assignedAny value sent for these fields is ignored — id is resolved from the existing row, projectId is the path project, lastUpdatedAt is always set to the current time

Notes

  • name must match definitionName in the path (case-insensitive) once resolved, otherwise a 400 Bad Request is returned
  • The definition named definitionName must already exist in the caller's visible scope, otherwise a 400 Bad Request ("was not found") is returned
  • If the existing definition is built-in, or the incoming body sets "builtIn": true, the update is rejected with a 400 Bad Request ("Built-in provider definitions are read-only.")
  • No _class discriminator — this is a plain entity body

Response

Success Response (200 OK)

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

EnumStatus

  • SUCCESS - Operation successful
  • FAILURE - Operation failed

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Provider definition (name: internal-llm-gateway) was not found!"
}

or

{
"status": "FAILURE",
"resultMessage": "Built-in provider definitions are read-only."
}

or

{
"status": "FAILURE",
"resultMessage": "Provider definition name in path (internal-llm-gateway) does not match name in body (other-name)!"
}

Error Response (401 Unauthorized)

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

cURL Example

curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/llm-provider-definitions/internal-llm-gateway/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "internal-llm-gateway",
"code": "internal-llm-gateway",
"displayName": "Internal LLM Gateway (v2 rollout)",
"defaultEndpoint": "https://llm-gateway-v2.internal.example.com/v1",
"defaultAuthScheme": "API_KEY_HEADER",
"defaultAuthHeaderName": "x-api-key"
}'

Permissions

  • User must have AI_DEVELOPMENT + MANAGE permission in the project

Notes and Warnings

  • Definition Must Exist:
    • PUT fails with "was not found" if no definition with that name exists in the caller's visible scope — use Create LLM Provider Definition (upsert) to create one
  • Built-in Is Read-Only:
    • Both the target row and the incoming body are checked; updating an already-built-in definition, or sending "builtIn": true, is rejected the same way
  • No _class Discriminator:
    • Unlike ConnectionConfigLlm (LLM Provider) bodies, this entity is not polymorphic
  • No Secrets, No Deploy:
    • The entity carries no credential fields, and updating a definition never triggers an AI Gateway worker deploy