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

# Update Model

> Set or rename a model's ``name`` (unique per org).

The console drives this; both naming an unnamed model and renaming an
existing one are the same call. A name already taken in the org surfaces as
409 (the partial unique index is the guard); the request body's validator
rejects malformed names with 422 before reaching here.

Owner-scoped, matching ``delete``: a member can read the org's models but
only rename their own (a non-owned model returns 404).



## OpenAPI

````yaml https://api.outerproduct.com/openapi.json patch /v1/models/{model_id}
openapi: 3.1.0
info:
  title: OuterProduct API
  description: >-
    Public-facing REST API for OuterProduct model distillation, prediction, and
    explanation.
  version: 0.1.8
servers: []
security: []
paths:
  /v1/models/{model_id}:
    patch:
      tags:
        - models
      summary: Update Model
      description: >-
        Set or rename a model's ``name`` (unique per org).


        The console drives this; both naming an unnamed model and renaming an

        existing one are the same call. A name already taken in the org surfaces
        as

        409 (the partial unique index is the guard); the request body's
        validator

        rejects malformed names with 422 before reaching here.


        Owner-scoped, matching ``delete``: a member can read the org's models
        but

        only rename their own (a non-owned model returns 404).
      operationId: update_model_v1_models__model_id__patch
      parameters:
        - name: model_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Model Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateModelRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateModelRequest:
      properties:
        name:
          type: string
          title: Name
          description: New human-readable model name, unique per org.
      type: object
      required:
        - name
      title: UpdateModelRequest
      description: |-
        ``PATCH /v1/models/{model_id}`` — set or rename a model's name.

        Names are unique per org; a clash is reported as ``409``. Whitespace is
        normalized so a name round-trips through lookup.
    ModelResponse:
      properties:
        id:
          $ref: '#/components/schemas/ID'
          description: The canonical server-assigned model id.
        short_id:
          type: string
          title: Short Id
          description: Short, human-friendly model handle, e.g. ``mdl-7bQ2xV9mKp4R``.
        name:
          type: string
          title: Name
          description: >-
            Human-readable model name, unique per org. Server-generated at
            creation; editable via ``PATCH /v1/models/{model_id}``.
        user_id:
          type: string
          title: User Id
          description: Id of the user who created the model (the creator/owner).
        model_type:
          type: string
          enum:
            - training
            - reasoning
            - sequence_reasoning
          title: Model Type
          description: >-
            ``training`` for /v1/training_jobs results; ``reasoning`` for
            /v1/reasoning_jobs on flat tasks; ``sequence_reasoning`` for
            /v1/reasoning_jobs on a sequence task (predict + per-entity drivers
            only).
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        hyperparameters:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/JsonValue'
              type: object
            - type: 'null'
          title: Hyperparameters
          description: The winning trial's hyperparameters (model-family specific).
        validation_metrics:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Validation Metrics
          description: >-
            Cross-validation scores the optimizer selected on, keyed by metric
            name (e.g. ``{"auc": 0.91}``).
        source_tables:
          items:
            type: string
          type: array
          title: Source Tables
          description: >-
            Names of the source tables the model trained on, captured at
            finalize from its training plan (read relations). Empty for models
            recorded before this was captured.
      type: object
      required:
        - id
        - short_id
        - name
        - user_id
        - model_type
      title: ModelResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ID:
      anyOf:
        - type: string
          format: uuid
        - type: string
    JsonValue: {}
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key or OAuth2/OIDC access token
      description: >-
        An API key or OAuth2/OIDC access token sent as `Authorization: Bearer
        <token>`.

````