跳到主要内容

setRestrictedAiModels

RestrictedAiModelsWrapper setRestrictedAiModels(SetRestrictedAiModelsRequestDto)

PUT /api/2.0/portal/payment/ai-model/restrictions

Set restricted AI models

Replaces the whole set of AI chat models barred on this portal: the body is the complete set that is to hold, so adding one restriction means sending the new model together with the ones already restricted, lifting one means leaving it out, and an empty set lifts them all. Read the current set from GET api/2.0/portal/payment/ai-model/restrictions and the model identifiers from GET api/2.0/portal/payment/ai-prices before calling. The installation needs a billing service and the AI gateway configured, the portal needs a billing customer, and the caller needs the permission to edit the portal settings as well as DocSpace administrator rights. The call is mutating and idempotent - sending the same set twice leaves the same state - and it is written to the portal audit trail. It takes effect on the next AI request, so a conversation already open on a model that has just been barred cannot go on with it. The stored set comes back in the answer.

Parameters​

NameInTypeDescriptionNotes
SetRestrictedAiModelsRequestDtobodySetRestrictedAiModelsRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The set of barred AI chat models as it was storedRestrictedAiModelsWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, or models is missing or null--
403The caller has no portal-settings right or is not a DocSpace administrator, or the installation has no billing service or no AI gateway configured--
404This portal has no billing customer yet--
500The AI gateway answers with an error or cannot be reached--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

RestrictedAiModelsWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json