# Update Workspace Model

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Update Workspace Model"}
>
</Heading>

<MethodEndpoint
  method={"patch"}
  path={"/api/v2/workspaces/{workspace_id}/models/custom/{model_id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Updates an existing workspace-scoped custom model definition.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"The unique identifier of the model.","in":"path","name":"model_id","required":true,"schema":{"description":"The unique identifier of the model.","format":"uuid","title":"Model Id","type":"string"}},{"description":"Type the id of the workspace.","in":"path","name":"workspace_id","required":true,"schema":{"description":"Type the id of the workspace.","format":"uuid","title":"Workspace Id","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"properties":{"chat_generator_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The configuration for the chat generator as expected in a pipeline YAML","title":"Chat Generator Config"},"generation_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The available generation kwargs for the model as OpenAPI schema","title":"Generation Kwargs"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name of the model, e.g., 'gpt-5' or 'Claude 4 Sonnet'","title":"Name"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The provider of the model, e.g., 'openai' or 'anthropic'","title":"Provider"}},"title":"UpdateModelRequest","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{"properties":{"chat_generator_config":{"additionalProperties":true,"description":"The configuration for the chat generator as expected in a pipeline YAML","title":"Chat Generator Config","type":"object"},"connected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the model is connected and ready to use (e.g., API key is set)","title":"Connected"},"created_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Timestamp when this model definition was created.","title":"Created At"},"created_by":{"anyOf":[{"properties":{"family_name":{"description":"Family name of a user.","title":"Family name","type":"string"},"given_name":{"description":"Given name of a user.","title":"Given name","type":"string"},"user_id":{"description":"Unique identifier of a user.","format":"uuid","title":"User ID","type":"string"}},"required":["given_name","family_name","user_id"],"title":"Oauth User","type":"object"},{"type":"null"}],"description":"The user who created this model definition."},"generation_kwargs":{"additionalProperties":true,"description":"The available generation kwargs for the model as OpenAPI schema","title":"Generation Kwargs","type":"object"},"last_updated_by":{"anyOf":[{"properties":{"family_name":{"description":"Family name of a user.","title":"Family name","type":"string"},"given_name":{"description":"Given name of a user.","title":"Given name","type":"string"},"user_id":{"description":"Unique identifier of a user.","format":"uuid","title":"User ID","type":"string"}},"required":["given_name","family_name","user_id"],"title":"Oauth User","type":"object"},{"type":"null"}],"description":"The user who last updated this model definition."},"model_id":{"description":"The unique identifier of the model available for the node.","format":"uuid","title":"Model Id","type":"string"},"name":{"description":"The name of the model, e.g., 'gpt-5' or 'Claude 4 Sonnet'","title":"Name","type":"string"},"origin":{"default":"PLATFORM","description":"Indicates if a model is a custom model saved in a workspace (WORKSPACE) or organization (ORGANIZATION) or a built-in model provided by the platform (PLATFORM).","enum":["WORKSPACE","ORGANIZATION","PLATFORM"],"title":"ModelOrigin","type":"string"},"provider":{"description":"The provider of the model, e.g., 'openai' or 'anthropic'","title":"Provider","type":"string"},"updated_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Timestamp when this model definition was last updated.","title":"Updated At"}},"required":["model_id","name","provider","connected","chat_generator_config","generation_kwargs"],"title":"Model","type":"object"}}},"description":"Successful Response"},"404":{"description":"We couldn't find a model with this ID. Check the ID and try again."},"409":{"description":"A model with this name already exists."},"422":{"description":"The model configuration is invalid."}}}
>
  
</StatusCodes>
