aiProfilesCreate
AiProfileMutationResult aiProfilesCreate(AiCreateProfileInput)
POST /api/2.0/ai/profiles/create
Create a provider profile
Creates an AI provider profile - the endpoint, credentials and model that a chat round runs on - and returns it. The name has to be unique, the credentials are probed against the live provider before anything is stored, and the portal's first profile also takes the Default assignment slot. Two inputs are refused outright: a baseUrl pointing at a private network address, and providerType: external, which delegates transport to the host application and therefore cannot work for a profile the server manages. On a portal running the AI gateway, profiles are managed centrally and this operation answers 403.
Parameters
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| AiCreateProfileInput | body | AiCreateProfileInput | [required] |
Responses
| Status code | Description | Type | Response headers |
|---|---|---|---|
| 200 | Whether the profile was created, with it in profile. A refusal is reported in error rather than as a status. | AiProfileMutationResult | - |
| 400 | The provider URL is missing, malformed, or points at a private network address. | AiErrorResponse | - |
| 401 | Missing asc_auth_key cookie or Authorization header. | AiErrorResponse | - |
| 403 | AI profiles are read-only on this portal because they are managed by the AI gateway. | AiErrorResponse | - |
| 413 | The request body is larger than 100 KB, the JSON parser's limit on this route. | AiErrorResponse | - |
| 500 | Unhandled failure. The reason is logged server-side and never echoed back. | AiErrorResponse | - |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json