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

# Update model settings and rates

> Updates rates and optional inference settings; `provider` and `model_id` are the row identity and are immutable on this endpoint. The rate cache is repopulated on success. Requires the `model:admin` scope. 



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json patch /v1/admin/models/{id}
openapi: 3.1.0
info:
  title: agentsfleet Control Plane API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/admin/models/{id}:
    patch:
      tags:
        - Admin
      summary: Update model settings and rates
      description: >-
        Updates rates and optional inference settings; `provider` and `model_id`
        are the row identity and are immutable on this endpoint. The rate cache
        is repopulated on success. Requires the `model:admin` scope. 
      operationId: update_admin_model
      parameters:
        - name: id
          in: path
          description: '`UUIDv7` of the resource.'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminModelPatch'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminModelUpdated'
        '401':
          description: No credential, or one this route does not accept
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: The credential is good and lacks the capability this route requires
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: No such resource, or none this caller may see
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The payload is over this route's ceiling
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: The instance is at its ceiling
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: The daemon failed to answer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A dependency this route needs is unreachable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - BearerAuth: []
components:
  schemas:
    AdminModelPatch:
      allOf:
        - $ref: '#/components/schemas/ModelRates'
          description: Existing rate fields remain flattened on the wire.
        - type: object
          properties:
            inference:
              oneOf:
                - type: 'null'
                - $ref: '#/components/schemas/ModelInference'
                  description: Omission preserves the current inference settings.
      description: Mutable model rates and optional replacement inference settings.
    AdminModelUpdated:
      type: object
      description: Successful model rate update.
      required:
        - id
        - updated
        - request_id
      properties:
        id:
          type: string
          description: Updated row identity.
        request_id:
          type: string
          description: Server-generated support correlation id.
        updated:
          type: boolean
          description: Always true after an update.
      additionalProperties: false
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - integer
            - 'null'
          format: int64
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
    ModelRates:
      type: object
      description: Mutable rate fields shared by admin model create and patch.
      required:
        - context_cap_tokens
        - input_nanos_per_mtok
        - cached_input_nanos_per_mtok
        - output_nanos_per_mtok
      properties:
        cached_input_nanos_per_mtok:
          type: integer
          format: int64
          description: Cached-input nanos per million tokens.
        context_cap_tokens:
          type: integer
          format: int32
          description: Maximum context tokens.
        input_nanos_per_mtok:
          type: integer
          format: int64
          description: Input-token nanos per million tokens.
        output_nanos_per_mtok:
          type: integer
          format: int64
          description: Output-token nanos per million tokens.
      additionalProperties: false
    ModelInference:
      type: object
      description: >-
        Admin-owned model settings; credentials remain separate vault
        references.
      required:
        - api
        - base_url
        - max_output_tokens
      properties:
        api:
          $ref: '#/components/schemas/InferenceApi'
          description: Explicit provider API; never inferred from a model identifier.
        base_url:
          type: string
          description: >-
            HTTPS provider base. Host safety is proven by the credential
            service.
        dialect:
          type:
            - string
            - 'null'
          description: Registered rig dialect, or absent for a plain compatible gateway.
        max_output_tokens:
          type: integer
          format: int32
          description: Model's configured maximum completion length, including reasoning.
          minimum: 0
      additionalProperties: false
    InferenceApi:
      type: string
      description: The provider API rig uses for this configured model.
      enum:
        - chat
        - responses
        - messages
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Obtain a token via the CLI auth flow (POST /v1/auth/sessions) or GitHub
        OAuth

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.