> ## 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.

# Get organization configured AI providers

> Legacy endpoint that returns the organization's configured providers (one per registered AiModel) with their API keys masked, plus the currentAiProviderIndex / currentAiModelIndex / currentAiModelVercelUniqueName fields. New consumers should prefer /settings + /assignments instead.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/ai-models/organization/{organizationId}
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}:
    get:
      tags:
        - AI Models
      summary: Get organization configured AI providers
      description: >-
        Legacy endpoint that returns the organization's configured providers
        (one per registered AiModel) with their API keys masked, plus the
        currentAiProviderIndex / currentAiModelIndex /
        currentAiModelVercelUniqueName fields. New consumers should prefer
        /settings + /assignments instead.
      operationId: get_organization_ai_providers
      parameters:
        - in: path
          name: organizationId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Organization AI providers returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsOrganizationProvidersResponse'
        '404':
          description: Organization credentials not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsErrorResponse'
        '500':
          description: Failed to fetch AI providers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModelsErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    AiModelsOrganizationProvidersResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            aiProviders:
              type: array
              items:
                $ref: '#/components/schemas/AiModelsMaskedProvider'
            currentAiProviderIndex:
              type: integer
              nullable: true
            currentAiModelIndex:
              type: integer
              nullable: true
            currentAiModelVercelUniqueName:
              type: string
              nullable: true
          additionalProperties: true
      required:
        - success
        - data
      additionalProperties: true
      example:
        success: true
        data:
          aiProviders:
            - _id: 65f9b1c2e8a1d4e001a0b1c3
              aiModel: 5f7b1c2e8a1d4e0012c3b4a5
              modelDetail: claude-sonnet-4-6
              apiKey: sk-a••••••••f9d2
          currentAiProviderIndex: 0
          currentAiModelIndex: 0
          currentAiModelVercelUniqueName: anthropic
    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
    AiModelsMaskedProvider:
      type: object
      description: >-
        Per-organization configured AI provider entry. `apiKey` is masked (first
        4 + last 4 characters).
      properties:
        _id:
          type: string
        aiModel:
          description: Populated `AiModelDocument` or the raw ObjectId reference.
          oneOf:
            - $ref: '#/components/schemas/AiModelDocument'
            - type: string
        modelDetail:
          type: string
        apiKey:
          type: string
          description: Masked representation of the stored API key.
      additionalProperties: true
      example:
        _id: 65f9b1c2e8a1d4e001a0b1c3
        aiModel: 5f7b1c2e8a1d4e0012c3b4a5
        modelDetail: claude-sonnet-4-6
        apiKey: sk-a••••••••f9d2
    AiModelDocument:
      type: object
      description: An `AiModel` registry entry (provider plus its available models).
      properties:
        _id:
          type: string
        providerName:
          type: string
        vercelUniqueName:
          type: string
          description: >-
            Vercel AI SDK provider identifier (e.g. `anthropic`, `openai`,
            `google`).
        websiteUrl:
          type: string
        modelDetails:
          type: array
          items:
            type: object
            additionalProperties: true
          description: >-
            Per-model metadata: `modelName`, optional `description`, pricing,
            etc.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 5f7b1c2e8a1d4e0012c3b4a5
        providerName: Anthropic
        vercelUniqueName: anthropic
        websiteUrl: https://www.anthropic.com
        modelDetails:
          - modelName: claude-sonnet-4-6
            description: Latest Sonnet release.
          - modelName: claude-haiku-4-5
            description: Fast, cost-efficient Haiku.
        createdAt: '2025-09-12T14:22:10.000Z'
        updatedAt: '2026-04-30T09:11:45.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````