{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-add-aimodel-provider-request-schema.json",
  "title": "AddAIModelProviderRequest",
  "description": "Request to add a new AI model provider",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-ai-models-providers-api-openapi.yml#/components/schemas/AddAIModelProviderRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "modelType",
    "provider",
    "configuration"
  ],
  "properties": {
    "modelType": {
      "$ref": "#/$defs/ModelType"
    },
    "provider": {
      "type": "string",
      "minLength": 1,
      "description": "Provider registry ID (e.g. openAI, gemini, azureOpenAI, groq)"
    },
    "configuration": {
      "$ref": "#/$defs/AIModelProviderConfiguration"
    },
    "isMultimodal": {
      "type": "boolean",
      "description": "Whether the model supports multimodal inputs",
      "default": false
    },
    "isReasoning": {
      "type": "boolean",
      "description": "Whether this is a reasoning model",
      "default": false
    },
    "isDefault": {
      "type": "boolean",
      "description": "Set as default model for this type",
      "default": false
    },
    "contextLength": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Maximum context length (tokens)"
    }
  },
  "$defs": {
    "AIModelProviderConfiguration": {
      "type": "object",
      "description": "Provider-specific configuration stored on each AI model entry.\n\n**Read shape:** user-facing GET responses return only `model`,\n`modelFriendlyName`, and `dimensions` (when stored). Values are copied as-is;\nother keys including credentials are omitted.\n\n**Write shape:** create and update still accept the full provider payload\n(Zod `configurationSchema` with `.passthrough()`). An omitted key retains\nthe stored value; send an empty string to clear one.\n\nProperties below are the documented union of the Zod base shape and registry-defined\nconfiguration keys (all optional unless required by a given provider at runtime).\n",
      "additionalProperties": false,
      "properties": {
        "model": {
          "type": "string",
          "description": "Model name/identifier. May be comma-separated for multiple models\n(e.g. `gpt-5.6-luna, gpt-5.6-terra`).\n"
        },
        "modelFriendlyName": {
          "type": "string",
          "description": "Display name for the model. Only allowed when `model` is a single name\n(not comma-separated).\n"
        },
        "apiKey": {
          "type": "string",
          "description": "API key for the provider"
        },
        "endpoint": {
          "type": "string",
          "description": "Custom endpoint URL (Azure OpenAI, self-hosted, Wispr override)"
        },
        "organizationId": {
          "type": "string",
          "description": "Organization ID (OpenAI)"
        },
        "deploymentName": {
          "type": "string",
          "description": "Deployment name (Azure OpenAI)"
        },
        "provider": {
          "type": "string",
          "description": "Bedrock model vendor (e.g. anthropic, cohere) or provider name override"
        },
        "customProvider": {
          "type": "string",
          "description": "Custom Bedrock vendor name when `provider` is `other`"
        },
        "awsAccessKeyId": {
          "type": "string",
          "description": "AWS access key (Bedrock). Optional - omit to use IAM role credentials."
        },
        "awsAccessSecretKey": {
          "type": "string",
          "description": "AWS secret key (Bedrock). Optional - omit to use IAM role credentials."
        },
        "region": {
          "type": "string",
          "description": "AWS region (Bedrock)"
        },
        "project": {
          "type": "string",
          "description": "GCP project ID (Vertex AI)"
        },
        "location": {
          "type": "string",
          "description": "Vertex AI region (e.g. us-central1)"
        },
        "serviceAccountJson": {
          "type": "string",
          "description": "Google Cloud service account JSON key (Vertex AI). Uploaded as a string;\ntreated as a secret at runtime.\n"
        },
        "dimensions": {
          "description": "Embedding output dimensions override (when supported by the model).\nStored configs may use an empty string when unset (registry default).\n",
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "string",
              "enum": [
                ""
              ]
            }
          ]
        },
        "voice": {
          "type": "string",
          "description": "Default TTS voice (OpenAI / Gemini audio)"
        },
        "responseFormat": {
          "type": "string",
          "description": "TTS audio format (e.g. mp3, wav)"
        },
        "device": {
          "type": "string",
          "description": "Whisper runtime device (auto, cpu, cuda)"
        },
        "computeType": {
          "type": "string",
          "description": "Whisper numeric precision (e.g. int8, float16)"
        },
        "modelDir": {
          "type": "string",
          "description": "Whisper model weights cache directory"
        },
        "language": {
          "type": "string",
          "description": "Wispr Flow default language (ISO 639-1) or empty for auto-detect"
        },
        "appType": {
          "type": "string",
          "description": "Wispr Flow output formatting (e.g. ai, email)"
        },
        "model_kwargs": {
          "type": "object",
          "description": "Optional keyword arguments forwarded to LangChain embedding/LLM clients\n(mirrors Zod `z.record(z.any())`). Used by HuggingFace (`device`, `api_key`)\nand Bedrock (`max_tokens`) paths in Python; values are typically string,\nnumber, or boolean. Omitted when not configured.\n",
          "additionalProperties": {}
        },
        "encode_kwargs": {
          "type": "object",
          "description": "Optional encoding kwargs for embedding models (mirrors Zod\n`z.record(z.any())`). Commonly `normalize_embeddings` (boolean) for\nHuggingFace and SentenceTransformer providers. Omitted when not configured.\n",
          "additionalProperties": {}
        },
        "cache_folder": {
          "type": "string",
          "description": "Cache folder for models"
        }
      }
    },
    "ModelType": {
      "type": "string",
      "enum": [
        "llm",
        "embedding",
        "ocr",
        "slm",
        "reasoning",
        "multiModal",
        "imageGeneration",
        "tts",
        "stt"
      ],
      "description": "Type of AI model"
    }
  }
}