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

# Update a route

> Updates a route. Replaces the entire target when provided, and the route name and owning team are immutable.



## OpenAPI

````yaml patch /v1/routes/{route_id}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/routes/{route_id}:
    parameters:
      - $ref: '#/components/parameters/route_id'
    patch:
      summary: Updates a route
      description: >-
        Replaces the entire target when provided. The route name and owning team
        are immutable.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRouteRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteV1'
      x-codeSamples:
        - lang: bash
          source: |-
            curl --request PATCH \
            --url https://api.baseten.co/v1/routes/{route_id} \
            --header "Authorization: Bearer $BASETEN_API_KEY" \
            --data '{
              "description": "Assistant for code review and debugging.",
              "display_name": "Assistant",
              "target": {
                "model": "zai-org/GLM-5.3",
                "type": "BASETEN_MODEL_API"
              }
            }'
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/routes/{route_id}"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "PATCH",
                url,
                headers=headers,
                json={'description': 'Assistant for code review and debugging.', 'display_name': 'Assistant', 'target': {'model': 'zai-org/GLM-5.3', 'type': 'BASETEN_MODEL_API'}}
            )

            print(response.text)
components:
  parameters:
    route_id:
      schema:
        type: string
      name: route_id
      in: path
      required: true
  schemas:
    UpdateRouteRequestV1:
      additionalProperties: false
      minProperties: 1
      properties:
        description:
          anyOf:
            - maxLength: 1000
              type: string
            - type: 'null'
          default: null
          description: >-
            New description. Omit to keep the current description; use an empty
            string to clear it. Null is not accepted.
          examples:
            - Assistant for code review and debugging.
          title: Description
        display_name:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            New display label. Omit to keep the current label; null is not
            accepted.
          examples:
            - Assistant
          title: Display Name
        target:
          anyOf:
            - discriminator:
                mapping:
                  ANTHROPIC:
                    $ref: '#/components/schemas/RouteTargetAnthropicV1'
                  BASETEN_MODEL_API:
                    $ref: '#/components/schemas/RouteTargetBasetenModelAPIV1'
                  OPENAI:
                    $ref: '#/components/schemas/RouteTargetOpenAIV1'
                  OPENAI_COMPATIBLE:
                    $ref: '#/components/schemas/RouteTargetOpenAICompatibleV1'
                  VERTEX:
                    $ref: '#/components/schemas/RouteTargetVertexV1'
                  XAI:
                    $ref: '#/components/schemas/RouteTargetXAIV1'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/RouteTargetBasetenModelAPIV1'
                - $ref: '#/components/schemas/RouteTargetAnthropicV1'
                - $ref: '#/components/schemas/RouteTargetOpenAIV1'
                - $ref: '#/components/schemas/RouteTargetXAIV1'
                - $ref: '#/components/schemas/RouteTargetVertexV1'
                - $ref: '#/components/schemas/RouteTargetOpenAICompatibleV1'
            - type: 'null'
          description: >-
            Replaces the entire target. Omit to keep the current target; null is
            not accepted.
          examples:
            - model: zai-org/GLM-5.3
              type: BASETEN_MODEL_API
          title: Target
      title: UpdateRouteRequestV1
      type: object
    RouteV1:
      properties:
        id:
          description: Stable route identifier.
          title: Id
          type: string
        name:
          description: Immutable name to send in the inference request's model field.
          title: Name
          type: string
        team_id:
          description: Identifier of the owning team.
          title: Team Id
          type: string
        team_name:
          description: Name of the owning team.
          title: Team Name
          type: string
        display_name:
          description: Display label, defaulting to the route name.
          title: Display Name
          type: string
        description:
          description: Short description of the route, empty when unset.
          title: Description
          type: string
        target:
          description: Configured upstream target.
          discriminator:
            mapping:
              ANTHROPIC:
                $ref: '#/components/schemas/RouteTargetAnthropicV1'
              BASETEN_MODEL_API:
                $ref: '#/components/schemas/RouteTargetBasetenModelAPIV1'
              OPENAI:
                $ref: '#/components/schemas/RouteTargetOpenAIV1'
              OPENAI_COMPATIBLE:
                $ref: '#/components/schemas/RouteTargetOpenAICompatibleV1'
              VERTEX:
                $ref: '#/components/schemas/RouteTargetVertexV1'
              XAI:
                $ref: '#/components/schemas/RouteTargetXAIV1'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/RouteTargetBasetenModelAPIV1'
            - $ref: '#/components/schemas/RouteTargetAnthropicV1'
            - $ref: '#/components/schemas/RouteTargetOpenAIV1'
            - $ref: '#/components/schemas/RouteTargetXAIV1'
            - $ref: '#/components/schemas/RouteTargetVertexV1'
            - $ref: '#/components/schemas/RouteTargetOpenAICompatibleV1'
          title: Target
        invoke_url:
          description: Base URL for inference requests using this route.
          title: Invoke Url
          type: string
        created_at:
          description: Creation time, ISO 8601.
          format: date-time
          title: Created At
          type: string
      required:
        - id
        - name
        - team_id
        - team_name
        - display_name
        - description
        - target
        - invoke_url
        - created_at
      title: RouteV1
      type: object
    RouteTargetAnthropicV1:
      additionalProperties: false
      properties:
        type:
          const: ANTHROPIC
          description: Target kind for Anthropic.
          title: Type
          type: string
        model:
          description: Model name sent to the provider.
          minLength: 1
          title: Model
          type: string
        secret_name:
          description: Name of a credential secret owned by the route's team.
          minLength: 1
          title: Secret Name
          type: string
      required:
        - type
        - model
        - secret_name
      title: RouteTargetAnthropicV1
      type: object
    RouteTargetBasetenModelAPIV1:
      additionalProperties: false
      properties:
        type:
          const: BASETEN_MODEL_API
          description: Target kind for a Baseten Model API.
          title: Type
          type: string
        model:
          description: Name of the target Model API.
          minLength: 1
          title: Model
          type: string
      required:
        - type
        - model
      title: RouteTargetBasetenModelAPIV1
      type: object
    RouteTargetOpenAIV1:
      additionalProperties: false
      properties:
        type:
          const: OPENAI
          description: Target kind for OpenAI.
          title: Type
          type: string
        model:
          description: Model name sent to the provider.
          minLength: 1
          title: Model
          type: string
        secret_name:
          description: Name of a credential secret owned by the route's team.
          minLength: 1
          title: Secret Name
          type: string
      required:
        - type
        - model
        - secret_name
      title: RouteTargetOpenAIV1
      type: object
    RouteTargetOpenAICompatibleV1:
      additionalProperties: false
      properties:
        type:
          const: OPENAI_COMPATIBLE
          description: Target kind for an OpenAI-compatible provider.
          title: Type
          type: string
        model:
          description: Model name sent to the provider.
          minLength: 1
          title: Model
          type: string
        secret_name:
          description: Name of a credential secret owned by the route's team.
          minLength: 1
          title: Secret Name
          type: string
        base_url:
          description: HTTPS base URL of the OpenAI-compatible provider.
          minLength: 1
          title: Base Url
          type: string
      required:
        - type
        - model
        - secret_name
        - base_url
      title: RouteTargetOpenAICompatibleV1
      type: object
    RouteTargetVertexV1:
      additionalProperties: false
      properties:
        type:
          const: VERTEX
          description: Target kind for Google Vertex AI.
          title: Type
          type: string
        model:
          description: Model name sent to the provider.
          minLength: 1
          title: Model
          type: string
        secret_name:
          description: Name of a credential secret owned by the route's team.
          minLength: 1
          title: Secret Name
          type: string
        vertex_config:
          $ref: '#/components/schemas/VertexTargetConfigV1'
          description: Google Vertex configuration.
      required:
        - type
        - model
        - secret_name
        - vertex_config
      title: RouteTargetVertexV1
      type: object
    RouteTargetXAIV1:
      additionalProperties: false
      properties:
        type:
          const: XAI
          description: Target kind for xAI.
          title: Type
          type: string
        model:
          description: Model name sent to the provider.
          minLength: 1
          title: Model
          type: string
        secret_name:
          description: Name of a credential secret owned by the route's team.
          minLength: 1
          title: Secret Name
          type: string
      required:
        - type
        - model
        - secret_name
      title: RouteTargetXAIV1
      type: object
    VertexTargetConfigV1:
      properties:
        project_id:
          description: Google Cloud project ID or project number.
          examples:
            - my-gcp-project
            - '464036093014'
          title: Project Id
          type: string
        location:
          description: Google Cloud location.
          examples:
            - global
          title: Location
          type: string
      required:
        - project_id
        - location
      title: VertexTargetConfigV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````