Overview
/
Developer Tools
/
API Reference
/
ML
/
Open a websocket to prompt the ML copilot.

Open a websocket to prompt the ML copilot

WebSocket URL example

wss://api.zoo.dev/ws/ml/copilot

Query string parameters

  • ?replay=

    boolean
    //
  • &conversation_id=

    UUID
    //
  • &pr=

    uint64
    //

WebSocket request

  • //
    {
    • type:

      "attachment_response",
    • error:

      string,
      //
    • prompt_id:

      stringUUID,
      //
    • request_id:

      string,
      //
    • seq:

      numberint32,
      //
    • :

      [[ ... ]
      //
      • //
        • :

          [[ ... ],
          //
          • numberuint8
          ]
        • data_ref:

          string,
          //
        • mimetype:

          string,
          //
        • name:

          string,
          //
        • :

          {{ ... }
          //
          • [key]:

            string
          }
        }
      ]
    }
  • //
    {
    • type:

      "headers",
    • :

      {{ ... }
      //
      • [key]:

        string
      }
    }
  • //
    {
    • type:

      "list_modes"
    }
  • //
    {
    • type:

      "ping"
    }
  • //
    {
    • type:

      "project_context",
    • project_name:

      string,
      //
    • :

      {{ ... }
      //
      • :

        [[ ... ]
        • numberuint8
        ]
      }
    }
  • //
    {
    • type:

      "system",
    • command:

      "new"+5
      • //Reset the conversation state, by creating a new state.
        "new"
      • //Disconnect the client, which can be used to end the session.
        "bye"
      • //Continue a previously-started turn after the client reconnects.
        "continue"
      • //Interrupt the current prompt that is being processed.
        "interrupt"
      • //Cancel the current prompt that is being processed.
        "cancel"
      • //Answer now, which forces the AI to finish the current response.
        "answer_now"
      //
    }
  • //
    {
    • type:

      "user",
    • content:

      string,
      //
    • project_name:

      string,
      //
    • :

      [[ ... ],
      //
      • //
        • :

          [[ ... ],
          //
          • numberuint8
          ]
        • data_ref:

          string,
          //
        • mimetype:

          string,
          //
        • name:

          string,
          //
        • :

          {{ ... }
          //
          • [key]:

            string
          }
        }
      ]
    • :

      {{ ... },
      //
      • :

        [[ ... ]
        • numberuint8
        ]
      }
    • :

      [[ ... ],
      //
      • one of

        "edit_kcl_code"+3
        • //The tool for generating or editing KCL code based on user prompts.
          "edit_kcl_code"
        • //The tool for generating CAD models from textual descriptions.
          "text_to_cad"
        • //The tool for querying a mechanical knowledge base.
          "mechanical_knowledge_base"
        • //The tool for searching the web for information.
          "web_search"
        //
      ]
    • mode:

      "fast"+3
      • //Use a combination of models and reasoning effort for fast results.
        "fast"
      • //Use a model and effort that results in thoughtful responses.
        "thoughtful"
      • //Let the system automatically choose the model and reasoning effort.
        "auto"
      • //Use the private Zoo Pro model for internal Zookeeper workflows.
        "zookeeper_pro"
      ,
      //
    • model:

      "gpt5_nano"+7
      • //gpt-5-nano
        "gpt5_nano"
      • //gpt-5-mini
        "gpt5_mini"
      • //gpt-5-codex
        "gpt5_codex"
      • //gpt-5
        "gpt5"
      • //o3-mini
        "o3_mini"
      • //azure o3-mini
        "azure_o3_mini"
      • //azure gpt-4o
        "azure_gpt4o"
      • //azure gpt-4o-mini
        "azure_gpt4o_mini"
      ,
      //
    • reasoning_effort:

      "low"+3
      • //Low reasoning
        "low"
      • //Medium reasoning
        "medium"
      • //High reasoning
        "high"
      • //Xhigh reasoning
        "xhigh"
      ,
      //
    • :

      [[ ... ]
      //
      • //
        • file:

          string,
          //
        • prompt:

          string,
          //
        • :

          {{ ... }
          //
          • :

            {{ ... },
            //
            • column:

              numberuint32,
              //
            • line:

              numberuint32
              //
            }
          • :

            {{ ... }
            //
            • column:

              numberuint32,
              //
            • line:

              numberuint32
              //
            }
          }
        }
      ]
    }

WebSocket response

  • //
    {
    • :

      {{ ... }
      • request_id:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • reason:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • conversation_id:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • delta:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • completed_at:

        stringISO-8601,
        //
      • conversation_id:

        string,
        //
      • id:

        stringUUID,
        //
      • started_at:

        stringISO-8601,
        //
      • whole_response:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • detail:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • :

        [[ ... ]
        //
        • //
          • :

            [[ ... ],
            //
            • numberuint8
            ]
          • data_ref:

            string,
            //
          • mimetype:

            string,
            //
          • name:

            string,
            //
          • :

            {{ ... }
            //
            • [key]:

              string
            }
          }
        ]
      }
    }
  • //
    {
    • :

      {{ ... }
      • text:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • default_mode:

        string,
        //
      • :

        [[ ... ]
        //
        • //
          • description:

            string,
            //
          • disabled:

            boolean,
            //
          • icon:

            string,
            //
          • id:

            string,
            //
          • label:

            string
            //
          }
        ]
      }
    }
  • //
    {
    • pong:

      {}
    }
  • //
    {
    • :

      {{ ... }
      • :

        {{ ... }
        //
        • [key]:

          string
        }
      }
    }
  • //
    {
    • :

      //
      • //
        {
        • type:

          "created_kcl_file",
        • content:

          string,
          //
        • file_name:

          string
          //
        }
      • //
        {
        • type:

          "created_project_file",
        • content:

          string,
          //
        • file_name:

          string
          //
        }
      • //
        {
        • type:

          "deleted_kcl_file",
        • file_name:

          string
          //
        }
      • //
        {
        • type:

          "deleted_project_file",
        • file_name:

          string
          //
        }
      • //
        {
        • type:

          "design_plan",
        • :

          [[ ... ]
          //
          • //
            • edit_instructions:

              string,
              //
            • filepath_to_edit:

              string
              //
            }
          ]
        }
      • //
        {
        • type:

          "feature_tree_outline",
        • content:

          string
          //
        }
      • //
        {
        • type:

          "generated_kcl_code",
        • code:

          string
          //
        }
      • //
        {
        • type:

          "kcl_code_error",
        • error:

          string
          //
        }
      • //
        {
        • type:

          "kcl_code_examples",
        • content:

          string
          //
        }
      • //
        {
        • type:

          "kcl_docs",
        • content:

          string
          //
        }
      • //
        {
        • type:

          "markdown",
        • content:

          string
          //
        }
      • //
        {
        • type:

          "text",
        • content:

          string
          //
        }
      • //
        {
        • type:

          "updated_kcl_file",
        • content:

          string,
          //
        • file_name:

          string
          //
        }
      • //
        {
        • type:

          "updated_project_file",
        • content:

          string,
          //
        • file_name:

          string
          //
        }
    }
  • //
    {
    • :

      {{ ... }
      • :

        [[ ... ]
        //
          • numberuint8
          ]
        ]
      }
    }
  • //
    {
    • :

      {{ ... }
      • conversation_id:

        stringUUID,
        //
      • :

        [[ ... ],
        //
        • string
        ]
      • only_metadata:

        boolean,
        //
      • prompt_id:

        stringUUID,
        //
      • request_id:

        string,
        //
      • seq:

        numberint32
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • api_call_id:

        string
        //
      }
    }
  • //
    {
    • :

      {{ ... }
      • :

        //
        • //
          {
          • type:

            "edit_kcl_code",
          • error:

            string,
            //
          • project_name:

            string,
            //
          • status_code:

            numberint32,
            //
          • :

            {{ ... },
            //
            • [key]:

              string
            }
          • :

            {{ ... }
            //
            • run_id:

              string,
              //
            • :

              [[ ... ]
              //
              • //
                • //
                  {
                  • contents:

                    string,
                    //
                  • path:

                    string,
                    //
                  • status:

                    "created"
                  }
                • //
                  {
                  • path:

                    string,
                    //
                  • previous_contents:

                    string,
                    //
                  • status:

                    "deleted"
                  }
                • //
                  {
                  • diff:

                    string,
                    //
                  • path:

                    string,
                    //
                  • status:

                    "modified"
                  }
              ]
            }
          }
        • //
          {
          • type:

            "mechanical_knowledge_base",
          • response:

            string
            //
          }
        • //
          {
          • type:

            "text_to_cad",
          • error:

            string,
            //
          • project_name:

            string,
            //
          • status_code:

            numberint32,
            //
          • :

            {{ ... }
            //
            • [key]:

              string
            }
          }
      }
    }
  • //
    {
    • :

      {{ ... }
      //
      • bucket:

        string,
        //
      • prompt_template:

        string,
        //
      • :

        [[ ... ],
        //
        • string
        ]
      • stage:

        string
        //
      }
    }