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

# Add model to group

> TODO: Add model instance to a model group.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml post /v4/model-groups/{model_group_id}/models/{model_instance_id}
openapi: 3.1.0
info:
  title: EGP API V4
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/model-groups/{model_group_id}/models/{model_instance_id}:
    post:
      tags:
        - Models
      summary: Add model to group
      description: 'TODO: Add model instance to a model group.'
      operationId: POST-V4-/v3/model-groups/{model_group_id}/models/{model_instance_id}
      parameters:
        - name: model_group_id
          in: path
          required: true
          schema:
            title: Model Group Id
            type: string
        - name: model_instance_id
          in: path
          required: true
          schema:
            title: Model Instance Id
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInstanceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from scale_gp import SGPClient

            client = SGPClient(
                api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
            )
            model_instance = client.model_groups.models.create(
                model_instance_id="model_instance_id",
                model_group_id="model_group_id",
            )
            print(model_instance.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/sgp-go\"\n\t\"github.com/stainless-sdks/sgp-go/option\"\n)\n\nfunc main() {\n\tclient := sgp.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmodelInstance, err := client.ModelGroups.Models.New(\n\t\tcontext.TODO(),\n\t\t\"model_group_id\",\n\t\t\"model_instance_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", modelInstance.ID)\n}\n"
components:
  schemas:
    ModelInstanceResponse:
      properties:
        name:
          type: string
          title: Name
        display_name:
          title: Display Name
          type: string
        model_vendor:
          $ref: '#/components/schemas/ModelVendor'
        model_type:
          $ref: '#/components/schemas/ModelType'
        base_model_id:
          title: Base Model Id
          type: string
        base_model_metadata:
          $ref: '#/components/schemas/BaseModelMetadata'
        model_creation_parameters:
          title: Model Creation Parameters
          additionalProperties: true
          type: object
        model_card:
          title: Model Card
          type: string
        training_data_card:
          title: Training Data Card
          type: string
        description:
          title: Description
          type: string
        model_template_id:
          title: Model Template Id
          type: string
        model_group_id:
          title: Model Group Id
          type: string
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
        created_by_user_id:
          type: string
          title: Created By User Id
          description: The user who originally created the entity.
        created_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that created the entity.
        request_schema:
          additionalProperties: true
          type: object
          title: Request Schema
          description: JSON schema for the requests to the model instance
        response_schema:
          additionalProperties: true
          type: object
          title: Response Schema
          description: JSON schema for the response to the model
        deployment_count:
          type: integer
          title: Deployment Count
          description: Number of deployments of this model instance
        supports_multi_turn:
          type: boolean
          title: Supports Multi Turn
          description: True if a model supports multi-turn conversations natively
      type: object
      required:
        - name
        - model_type
        - id
        - created_at
        - account_id
        - created_by_user_id
        - created_by_identity_type
        - request_schema
        - response_schema
        - deployment_count
        - supports_multi_turn
      title: ModelInstanceResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ModelVendor:
      type: string
      enum:
        - OPENAI
        - COHERE
        - GOOGLE
        - VERTEX_AI
        - ANTHROPIC
        - LAUNCH
        - LLMENGINE
        - BEDROCK
        - FIREWORKS_AI
        - OTHER
      title: ModelVendor
      description: |-
        An enum representing the different types of model vendors supported.

        Attributes:
            OPENAI: Denotes that the model vendor is OpenAI.
            COHERE: Denotes that the model vendor is Cohere.
            GOOGLE: Denotes that the model vendor is Google.
            ANTHROPIC: Denotes that the model vendor is Anthropic.
            LLMENGINE: Denotes that the model vendor is LLM Engine.
            OTHER: Denotes that the model vendor is Other.
    ModelType:
      type: string
      enum:
        - COMPLETION
        - CHAT_COMPLETION
        - AGENT
        - EMBEDDING
        - RERANKING
        - GENERIC
        - BUNDLE
      title: ModelType
      description: |-
        An enum representing the different types of models supported.

        Attributes:
            COMPLETION: Denotes that the model type is completion.
            CHAT_COMPLETION: Denotes that the model type is chat completion.
            AGENT: Denotes that the model type is agent.
            EMBEDDING: Denotes that the model type is embedding.
            RERANKING: Denotes that the model type is reranking.
            GENERIC: Denotes that the model type is generic.
            BUNDLE: "Not to be used directly - type to surface a model bundle in the UI - TODO: Explicitly type a bundle
    BaseModelMetadata:
      properties:
        ui_model_section_type:
          $ref: '#/components/schemas/UiModelSectionType'
        model_developer:
          title: Model Developer
          type: string
        model_license_url:
          title: Model License Url
          type: string
        delivery_date:
          title: Delivery Date
          type: string
        modelDetails:
          $ref: '#/components/schemas/BaseModelDetails'
      type: object
      title: BaseModelMetadata
    IdentifierTypeEnum:
      type: string
      enum:
        - user
        - service_account
      title: IdentifierTypeEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UiModelSectionType:
      type: string
      enum:
        - PARTNER
        - OPENSOURCE
        - CUSTOM
      title: UiModelSectionType
    BaseModelDetails:
      properties:
        number_of_parameters:
          title: Number Of Parameters
          type: integer
        token_context_window:
          title: Token Context Window
          type: integer
        languages:
          title: Languages
          type: integer
        alignments:
          title: Alignments
          type: integer
      type: object
      title: BaseModelDetails

````