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

# Update an existing AI provider configuration for organization

> Legacy endpoint that updates the modelDetail and/or apiKey on a single aiProviders entry identified by providerId. SUPERADMIN-only and tenant-scoped. At least one field must be supplied.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/ai-models/organization/{organizationId}/provider/{providerId}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/ai-models/organization/{organizationId}/provider/{providerId}:
    put:
      tags:
        - AI Models
      summary: Update an existing AI provider configuration for organization
      description: >-
        Legacy endpoint that updates the modelDetail and/or apiKey on a single
        aiProviders entry identified by providerId. SUPERADMIN-only and
        tenant-scoped. At least one field must be supplied.
      operationId: update_organization_ai_provider
      parameters:
        - in: path
          name: organizationId
          required: true
          schema:
            type: string
        - in: path
          name: providerId
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationAiProviderRequest'
      responses:
        '200':
          description: Provider updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsSimpleSuccessResponse'
        '400':
          description: No fields to update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsErrorResponse'
        '403':
          description: Only superadmins can configure AI provider credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsErrorResponse'
        '404':
          description: Organization credentials or provider not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsErrorResponse'
        '500':
          description: Failed to update AI provider
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateOrganizationAiProviderRequest:
      type: object
      properties:
        modelDetail:
          type: string
          description: >-
            New `modelName` for this provider entry; must exist in the
            underlying AiModel's `modelDetails`.
        apiKey:
          type: string
          description: >-
            Replacement provider API key; stored encrypted and never returned in
            GET responses.
      additionalProperties: true
      example:
        modelDetail: claude-haiku-4-5
    AiModelsSimpleSuccessResponse:
      type: object
      description: >-
        Generic success envelope used for delete / update endpoints that do not
        return a resource.
      properties:
        success:
          type: boolean
          enum:
            - true
        message:
          type: string
      required:
        - success
      additionalProperties: true
      example:
        success: true
        message: API key for anthropic removed successfully
    AiModelsErrorResponse:
      type: object
      description: >-
        Error envelope returned by AI Models endpoints. `error` may be present
        on contract-validation failures.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          description: >-
            Optional error detail (string or structured object on validation
            failures).
      required:
        - success
      additionalProperties: true
      example:
        success: false
        message: Organization credentials not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````