> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praxis-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or change the account's custom AI model of one model type

> Only the fields sent are changed. A new model needs a name, a key and an endpoint, and is off; an anthropic_cli model needs no endpoint. A google_cli model needs none either. A bedrock_cli model has no endpoint and no key: a body that sends api_url or api_key for it is refused, and a model switched to bedrock_cli keeps neither (its stored key is deleted). A new bedrock_cli model, a switch to bedrock_cli, and every save after which a bedrock_cli model is on need the account's AWS key pair (an access key id and a secret access key); a save that leaves an existing bedrock_cli model off does not. The Client Library Type must be one offered for the model type; left out, the stored one is kept, or the first offered one for a new model. The endpoint is an https address with a public host name. For anthropic_cli the endpoint may be left empty: the model is then called at Anthropic's own address (https://api.anthropic.com), and emptying an endpoint or setting one counts as another endpoint. An anthropic_cli endpoint whose path ends in /v1 is refused (a model switched off is not refused for it): type the base address, the requests add /v1/messages themselves. For google_cli the endpoint may be left empty too: the model is then called at Google's own address (https://generativelanguage.googleapis.com). A google_cli endpoint whose path ends in /v1, /v1beta or /v1alpha is refused (a model switched off is not refused for it): type the base address, the requests add /v1beta/models/… themselves. The key is stored encrypted and never returned; an empty api_key keeps the stored key, and another endpoint or another Client Library Type needs the key again (the stored key is only sent to the destination it was saved with). Setting status to active switches the model on for every Digital Twin of the account: one test request is sent first, and nothing is saved if it fails. The test request depends on the model type: a short completion for Conversation, Document Summarization, Knowledge Generation and Knowledge Generation Fallback; for Image Analysis a picture, whose colour the model must say; for Audio Transcription a short recording of the word hello, which must come back as text; for Text To Speech one spoken word in the voice alloy, which must come back as audio; for Moderation one harmless sentence, which must come back with a moderation result; for Image Generation and Video Generation a lookup of the model name at the endpoint (GET /models/{name}), which proves the address and the model name (and the key, when the endpoint asks for one), not that the model draws pictures or generates videos. A Video Generation endpoint must offer OpenAI's video requests (create a video, read its status, download it). For bedrock_cli the test request is signed with the account's AWS key pair, in the account's AWS region (the server's default region when the account has none): a Converse request for Conversation, Document Summarization, Knowledge Generation and Knowledge Generation Fallback, a Converse request with the picture for Image Analysis, and for Image Generation a lookup of the model id in AWS Bedrock (GetFoundationModel for a model's own id, which must make images; GetInferenceProfile for an inference profile id or ARN, which must be active, then GetFoundationModel on its first model, which must make images), which proves the key pair, the region and the id, not that the account may call the model. For google_cli the test request is a generateContent request for Conversation, Document Summarization, Knowledge Generation and Knowledge Generation Fallback, the same with the picture for Image Analysis, and for Image Generation and Video Analysis a lookup of the model name (GET /v1beta/models/{name}), which must offer generateContent when the endpoint lists the model's methods; it proves the address and the model name (and the key, when the endpoint asks for one), not that the model draws pictures or reads video. A Video Analysis model is sent a video smaller than 20 MB inside the request and a larger one through the endpoint's file requests (upload a file, read its state, delete it); each Video Analysis request asks for up to 4,096 output tokens, or the model's max_output_tokens when lower. Each Knowledge Generation request asks for up to the model's max_output_tokens; the test request does not check that value. While the model is on, a change of Client Library Type, endpoint, name or key is tested the same way.



## OpenAPI

````yaml /mdx/api-reference/admin/admin-api.json put /api/admin/accounts/{accountId}/aimodels/{modelUse}
openapi: 3.0.0
info:
  title: Pria Admin API
  version: 2.0.343
  description: >-
    Pria API Documentation Praxis's developer platform is a core part of our
    mission to empower organizations to grow better. Our APIs are designed to
    enable teams of any shape or size to build robust integrations that help
    them customize and get the most value out of Pria. All Pria APIs are built
    using REST conventions and designed to have a predictable URL structure.
    <br/>  <br/>They use many standard HTTP features, including methods (POST,
    GET, PUT, DELETE) and error response codes.  <br/> <br/>All API calls are
    made under https://hiimpria.ai/api and all responses return standard JSON.
    In these docs, you'll find lists of all available endpoints for a given API,
    along with interactive code blocks for building requests. For walkthroughs
    of basic usage for these APIs, check out the API guides. <br/> <br/>A
    session that a course page (Canvas) opened for an administrator — or that a
    Digital Twin's sign-in provider opened for one of its people — starts with
    user rights in that twin only: until the person confirms it's them with a
    code (POST /api/user/launch-scope/challenge, then /api/auth/mfa-resend and
    /api/auth/mfa-verify), every route outside that twin's day-to-day work
    answers 403 with code LAUNCH_SCOPE_STEP_UP and the twin's id.
servers:
  - url: https://hiimpria.ai
    description: Pria API Server
security: []
tags:
  - name: Authentication
    description: User authentication, registration, and password management (/api/auth)
  - name: OAuth
    description: OAuth authentication providers - Google, GitHub, SSO (/api/auth/oauth)
  - name: User
    description: User profile management and account operations (/api/user)
  - name: User Institutions
    description: User institution memberships and switching (/api/user/institution)
  - name: User Tools
    description: Available tools for authenticated users (/api/user/tools)
  - name: Institutions
    description: Institution settings and configuration (/api/user/institution)
  - name: Conversation
    description: AI conversation and Q&A endpoints (/api/ai)
  - name: Realtime
    description: Real-time voice AI and WebRTC sessions (/api/ai/rt)
  - name: Assistant
    description: AI assistant configuration and management (/api/user/assistant)
  - name: History
    description: Conversation history and favorites (/api/user/history)
  - name: RAG
    description: >-
      Document upload, embedding, and retrieval-augmented generation
      (/api/user/files, /api/user/rag)
  - name: Setting
    description: Instance variables and settings management (/api/user/setting)
  - name: Branding
    description: Digital twin branding and customization (/api/agent/branding)
  - name: Agent
    description: Agent engagement and session management (/api/agent)
  - name: SDK Launch
    description: >-
      SDK launch token signing and verification for secure iframe embedding
      (/api/auth/sdk-sign, /api/auth/sdk-verify)
  - name: Testing
    description: Health checks, diagnostics, and test endpoints (/api/test)
  - name: Admin Accounts
    description: Account management for account managers (/api/admin/account)
  - name: Admin Institutions
    description: Institution management for admins (/api/admin/institution)
  - name: Admin Users
    description: User management for admins (/api/admin/user)
  - name: Admin Entitlements
    description: >-
      User-institution relationships and permissions
      (/api/admin/userInstitution)
  - name: Admin Sessions
    description: Session management for admins (/api/admin/session)
  - name: Admin Histories
    description: Conversation history management and analytics (/api/admin/history)
  - name: Admin Assistants
    description: AI assistant management for admins (/api/admin/assistant)
  - name: Admin Questions
    description: Institution question and prompt management (/api/admin/question)
  - name: Admin Tools
    description: Tool configuration management (/api/admin/tool)
  - name: Admin AI Models
    description: AI model configuration (/api/admin/aimodel)
  - name: Admin MCP Servers
    description: Model Context Protocol server management (/api/admin/mcpserver)
  - name: Admin Feedbacks
    description: User feedback management (/api/admin/feedback)
  - name: Admin Uploads
    description: Upload management (/api/admin/upload)
  - name: Admin Charts
    description: Analytics and visualization chart management (/api/admin/chart)
  - name: Admin Memory
    description: Admin inspection and editing of user/instance memory parameters.
  - name: Admin Usage Limits
    description: Per-user usage-vs-cap reporting and account-wide at-limit counts.
paths:
  /api/admin/accounts/{accountId}/aimodels/{modelUse}:
    put:
      tags:
        - Admin Accounts
      summary: Create or change the account's custom AI model of one model type
      description: >-
        Only the fields sent are changed. A new model needs a name, a key and an
        endpoint, and is off; an anthropic_cli model needs no endpoint. A
        google_cli model needs none either. A bedrock_cli model has no endpoint
        and no key: a body that sends api_url or api_key for it is refused, and
        a model switched to bedrock_cli keeps neither (its stored key is
        deleted). A new bedrock_cli model, a switch to bedrock_cli, and every
        save after which a bedrock_cli model is on need the account's AWS key
        pair (an access key id and a secret access key); a save that leaves an
        existing bedrock_cli model off does not. The Client Library Type must be
        one offered for the model type; left out, the stored one is kept, or the
        first offered one for a new model. The endpoint is an https address with
        a public host name. For anthropic_cli the endpoint may be left empty:
        the model is then called at Anthropic's own address
        (https://api.anthropic.com), and emptying an endpoint or setting one
        counts as another endpoint. An anthropic_cli endpoint whose path ends in
        /v1 is refused (a model switched off is not refused for it): type the
        base address, the requests add /v1/messages themselves. For google_cli
        the endpoint may be left empty too: the model is then called at Google's
        own address (https://generativelanguage.googleapis.com). A google_cli
        endpoint whose path ends in /v1, /v1beta or /v1alpha is refused (a model
        switched off is not refused for it): type the base address, the requests
        add /v1beta/models/… themselves. The key is stored encrypted and never
        returned; an empty api_key keeps the stored key, and another endpoint or
        another Client Library Type needs the key again (the stored key is only
        sent to the destination it was saved with). Setting status to active
        switches the model on for every Digital Twin of the account: one test
        request is sent first, and nothing is saved if it fails. The test
        request depends on the model type: a short completion for Conversation,
        Document Summarization, Knowledge Generation and Knowledge Generation
        Fallback; for Image Analysis a picture, whose colour the model must say;
        for Audio Transcription a short recording of the word hello, which must
        come back as text; for Text To Speech one spoken word in the voice
        alloy, which must come back as audio; for Moderation one harmless
        sentence, which must come back with a moderation result; for Image
        Generation and Video Generation a lookup of the model name at the
        endpoint (GET /models/{name}), which proves the address and the model
        name (and the key, when the endpoint asks for one), not that the model
        draws pictures or generates videos. A Video Generation endpoint must
        offer OpenAI's video requests (create a video, read its status, download
        it). For bedrock_cli the test request is signed with the account's AWS
        key pair, in the account's AWS region (the server's default region when
        the account has none): a Converse request for Conversation, Document
        Summarization, Knowledge Generation and Knowledge Generation Fallback, a
        Converse request with the picture for Image Analysis, and for Image
        Generation a lookup of the model id in AWS Bedrock (GetFoundationModel
        for a model's own id, which must make images; GetInferenceProfile for an
        inference profile id or ARN, which must be active, then
        GetFoundationModel on its first model, which must make images), which
        proves the key pair, the region and the id, not that the account may
        call the model. For google_cli the test request is a generateContent
        request for Conversation, Document Summarization, Knowledge Generation
        and Knowledge Generation Fallback, the same with the picture for Image
        Analysis, and for Image Generation and Video Analysis a lookup of the
        model name (GET /v1beta/models/{name}), which must offer generateContent
        when the endpoint lists the model's methods; it proves the address and
        the model name (and the key, when the endpoint asks for one), not that
        the model draws pictures or reads video. A Video Analysis model is sent
        a video smaller than 20 MB inside the request and a larger one through
        the endpoint's file requests (upload a file, read its state, delete it);
        each Video Analysis request asks for up to 4,096 output tokens, or the
        model's max_output_tokens when lower. Each Knowledge Generation request
        asks for up to the model's max_output_tokens; the test request does not
        check that value. While the model is on, a change of Client Library
        Type, endpoint, name or key is tested the same way.
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            type: string
          description: Account ID
        - in: path
          name: modelUse
          required: true
          schema:
            type: string
            enum:
              - conversationModel
              - summaryModel
              - imageAnalysisModel
              - audioAnalysisModel
              - ttsModel
              - moderationModel
              - imageGenerationModel
              - videoGenerationModel
              - videoAnalysisModel
              - kagAnalysisModel
              - kagAnalysisFallbackModel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                client_library:
                  type: string
                  description: >-
                    One of the Client Library Types the GET lists for this model
                    type.
                api_url:
                  type: string
                  description: >-
                    Required, except for anthropic_cli, google_cli and
                    bedrock_cli. For anthropic_cli, the base address without
                    /v1; for google_cli, without an API version (/v1, /v1beta,
                    /v1alpha). Never sent for bedrock_cli.
                api_key:
                  type: string
                  description: >-
                    Write-only. Leave it empty to keep the stored key. Never
                    sent for bedrock_cli.
                features:
                  type: object
                  deprecated: true
                  description: Not read. May be left out.
                input_media:
                  type: object
                  deprecated: true
                  description: Not read. May be left out.
                output_media:
                  type: object
                  deprecated: true
                  description: Not read. May be left out.
                max_input_tokens:
                  type: integer
                  description: >-
                    Used by the Conversation, Document Summarization and Image
                    Analysis models only.
                max_output_tokens:
                  type: integer
                  description: >-
                    Used by the Conversation, Document Summarization, Image
                    Analysis, Video Analysis, Knowledge Generation and Knowledge
                    Generation Fallback models only.
                reasoning_effort:
                  type: string
                  nullable: true
                extended_context:
                  type: boolean
                picture_url:
                  type: string
                status:
                  type: string
                  enum:
                    - active
                    - inactive
      responses:
        '200':
          description: The model as saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    $ref: '#/components/schemas/AccountAiModel'
        '400':
          description: >-
            A value was refused (code INVALID_ARGUMENT; among them an api_url or
            api_key sent for bedrock_cli, and a bedrock_cli model that needs the
            account's AWS key pair on an account without one), or the test
            request failed (code ACCOUNT_MODEL_TEST_FAILED, with the endpoint's
            own message, or AWS's for bedrock_cli) — nothing was saved
        '403':
          description: Not a manager of this account
        '404':
          description: Account not found
      security:
        - apiKeyAuth: []
components:
  schemas:
    AccountAiModel:
      type: object
      properties:
        modelUse:
          type: string
          enum:
            - conversationModel
            - summaryModel
            - imageAnalysisModel
            - audioAnalysisModel
            - ttsModel
            - moderationModel
            - imageGenerationModel
            - videoGenerationModel
            - videoAnalysisModel
            - kagAnalysisModel
            - kagAnalysisFallbackModel
          description: >-
            The model type: Conversation, Document Summarization, Image
            Analysis, Audio Transcription, Text To Speech, Moderation, Image
            Generation, Video Generation, Video Analysis, Knowledge Generation
            or Knowledge Generation Fallback.
        name:
          type: string
          description: The model's name as the endpoint knows it.
        description:
          type: string
        api_url:
          type: string
          description: >-
            The endpoint: an https address with a public host name. Empty for an
            anthropic_cli model that has none. Always empty for a bedrock_cli
            model, which has no endpoint. Empty for a google_cli model that has
            none.
        endpointHost:
          type: string
          description: >-
            The host of the endpoint; api.anthropic.com for an anthropic_cli
            model without an endpoint. Empty for a bedrock_cli model.
            generativelanguage.googleapis.com for a google_cli model without an
            endpoint.
        client_library:
          type: string
          description: >-
            The Client Library Type the model is called with. One of the
            libraries `support` lists for the model type; openai_cli is an
            OpenAI-compatible endpoint; anthropic_cli is Anthropic's Messages
            API, offered for Conversation, Document Summarization, Image
            Analysis, Knowledge Generation and Knowledge Generation Fallback.
            bedrock_cli is AWS Bedrock, offered for the same five types and for
            Image Generation: it has no endpoint and no key, is used only while
            the account holds an AWS key pair (Shared Integrations), and is
            called with the account's pair, in the Digital Twin's AWS region,
            else the account's, else the server's default region. google_cli is
            Google GenAI, offered for the same five types, for Image Generation
            and for Video Analysis (the only Client Library Type offered for
            Video Analysis): its endpoint is optional (empty, the model is
            called at Google's own address,
            https://generativelanguage.googleapis.com), and it needs a key.
        features:
          type: object
          deprecated: true
          description: >-
            Kept for compatibility and not read. A model declares nothing: a
            Conversation model must support streaming and tool calls, an Image
            Analysis model must read pictures (the test request sends one).
        input_media:
          type: object
          deprecated: true
          description: Kept for compatibility and not read.
        output_media:
          type: object
          deprecated: true
          description: Kept for compatibility and not read.
        max_input_tokens:
          type: integer
          description: >-
            Used by the Conversation, Document Summarization and Image Analysis
            models only.
        max_output_tokens:
          type: integer
          description: >-
            Used by the Conversation, Document Summarization, Image Analysis,
            Video Analysis, Knowledge Generation and Knowledge Generation
            Fallback models only.
        reasoning_effort:
          type: string
          nullable: true
          description: none, low, medium, high or max.
        extended_context:
          type: boolean
        picture_url:
          type: string
        status:
          type: string
          enum:
            - active
            - inactive
          description: >-
            active (on: it answers for its model type in every Digital Twin of
            the account) or inactive (off: kept, not used).
        hasApiKey:
          type: boolean
          description: >-
            Whether a key is stored. The key itself is never returned. Always
            false for a bedrock_cli model.
        awsPair:
          type: boolean
          description: >-
            Only in the list (GET), and only for a bedrock_cli model: whether
            the account holds a complete AWS key pair. While it does not, the
            model is not used, even when it is on: each Digital Twin uses its
            own model. Left out when the pair could not be read. The pair itself
            is never returned.
        updatedAt:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: JWT token passed in x-access-token header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.