Overview
/
Developer Tools
/
API Reference
/
ML
/
Open a sponsored KCL migration connection. It cannot execute ordinary prompts.

Open a sponsored KCL migration connection. It cannot execute ordinary prompts

Billing: No usage charge

WebSocket URL example

wss://api.zoo.dev/ws/ml/kcl-migration

WebSocket request

  • //
    {
    • type:

      "application",
    • expected_revision:

      numberuint32,
      //
    • operation_id:

      stringUUID,
      //
    • status:

      "not_applied"+2▾
      • //The client has not confirmed application. API does not infer project state.
        "not_applied"
      • //The client reports completing the guarded project write (or redo).
        "applied"
      • //The client reports undoing the migration.
        "undone"
      //
    }
  • //
    {
    • type:

      "cancel",
    • operation_id:

      stringUUID
      //
    }
  • //
    {
    • type:

      "headers",
    • :

      {{ ... }
      • [key]:

        string
      }
    }
  • //
    {
    • type:

      "history",
    • conversation_id:

      stringUUID
      //
    }
  • //
    {
    • type:

      "ping"
    }
  • //
    {
    • type:

      "start",
    • :

      {{ ... }
      //
      • allow_preview:

        boolean,
        //
      • conversation_id:

        stringUUID,
        //
      • entrypoint:

        string,
        //
      • request_id:

        stringUUID,
        //
      • :

        {{ ... },
        //
        • :

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

        {{ ... },
        //
        • project_id:

          string,
          //
        • snapshot_id:

          string,
          //
        • :

          {{ ... }
          //
          • project_id:

            string,
            //
          • revision:

            string,
            //
          • writer_fence:

            string
            //
          }
        }
      • target:

        "3.0-preview"+1▾
        • //Unstable KCL 3 preview.
          "3.0-preview"
        • //Stable KCL 3. Availability also depends on the deployed worker and client.
          "3.0"
        //
      }
    }
  • //
    {
    • type:

      "status",
    • operation_id:

      stringUUID
      //
    }

WebSocket response

  • //
    {
    • type:

      "application",
    • operation_id:

      stringUUID,
      //
    • :

      {{ ... }
      //
      • revision:

        numberuint32,
        //
      • status:

        "not_applied"+2▾
        • //The client has not confirmed application. API does not infer project state.
          "not_applied"
        • //The client reports completing the guarded project write (or redo).
          "applied"
        • //The client reports undoing the migration.
          "undone"
        //
      }
    }
  • //
    {
    • type:

      "error",
    • detail:

      string
    }
  • //
    {
    • type:

      "history",
    • conversation_id:

      stringUUID,
      //
    • :

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

          stringUUID,
          //
        • conversation_id:

          stringUUID,
          //
        • created_at:

          stringISO-8601,
          //
        • detail:

          string,
          //
        • operation_id:

          stringUUID,
          //
        • prompt_id:

          stringUUID,
          //
        • :

          {{ ... },
          //
          • revision:

            numberuint32,
            //
          • status:

            "not_applied"+2▾
            • //The client has not confirmed application. API does not infer project state.
              "not_applied"
            • //The client reports completing the guarded project write (or redo).
              "applied"
            • //The client reports undoing the migration.
              "undone"
            //
          }
        • status:

          "running"+6▾
          • //Preparation, conversion, or validation is still running.
            "running"
          • //A validated candidate is ready for review. No project has been applied.
            "succeeded"
          • //The attempt failed.
            "failed"
          • //The original execution deadline expired.
            "timed_out"
          • //The attempt was cancelled, including loss of its execution connection.
            "cancelled"
          • //The source, target, or project is not supported.
            "unsupported"
          • //Execution, geometry, or behavioral equivalence could not be established.
            "validation_failed"
          //
        }
      ]
    }
  • //
    {
    • type:

      "operation",
    • :

      {{ ... }
      //
      • deadline:

        stringISO-8601,
        //
      • id:

        stringUUID,
        //
      • :

        {{ ... },
        //
        • project_id:

          string,
          //
        • snapshot_id:

          string,
          //
        • :

          {{ ... }
          //
          • project_id:

            string,
            //
          • revision:

            string,
            //
          • writer_fence:

            string
            //
          }
        }
      • :

        {{ ... },
        //
        • conversion_not_started:

          boolean,
          //
        • detail:

          string,
          //
        • :

          {{ ... },
          //
          • :

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

          "running"+6▾
          • //Preparation, conversion, or validation is still running.
            "running"
          • //A validated candidate is ready for review. No project has been applied.
            "succeeded"
          • //The attempt failed.
            "failed"
          • //The original execution deadline expired.
            "timed_out"
          • //The attempt was cancelled, including loss of its execution connection.
            "cancelled"
          • //The source, target, or project is not supported.
            "unsupported"
          • //Execution, geometry, or behavioral equivalence could not be established.
            "validation_failed"
          ,
          //
        • :

          {{ ... }
          //
          • behavior_preserved:

            boolean,
            //
          • geometry_preserved:

            boolean,
            //
          • rules_revision:

            string,
            //
          • runtime_version:

            string,
            //
          • source_executed:

            boolean,
            //
          • source_version:

            string,
            //
          • summary:

            string,
            //
          • target_executed:

            boolean,
            //
          • target:

            "3.0-preview"+1▾
            • //Unstable KCL 3 preview.
              "3.0-preview"
            • //Stable KCL 3. Availability also depends on the deployed worker and client.
              "3.0"
            //
          }
        }
      • status:

        "running"+6▾
        • //Preparation, conversion, or validation is still running.
          "running"
        • //A validated candidate is ready for review. No project has been applied.
          "succeeded"
        • //The attempt failed.
          "failed"
        • //The original execution deadline expired.
          "timed_out"
        • //The attempt was cancelled, including loss of its execution connection.
          "cancelled"
        • //The source, target, or project is not supported.
          "unsupported"
        • //Execution, geometry, or behavioral equivalence could not be established.
          "validation_failed"
        ,
        //
      • target:

        "3.0-preview"+1▾
        • //Unstable KCL 3 preview.
          "3.0-preview"
        • //Stable KCL 3. Availability also depends on the deployed worker and client.
          "3.0"
        //
      }
    }
  • //
    {
    • type:

      "pong"
    }
  • //
    {
    • type:

      "progress",
    • operation_id:

      stringUUID,
      //
    • :

      //
      • //
        {
        • :

          {{ ... }
          • detail:

            string,
            //
          • retryable:

            boolean,
            //
          • code:

            "missing_payment_method"+5▾
            • //The account has no payment method on file.
              "missing_payment_method"
            • //The account's payment method failed.
              "payment_method_failed"
            • //The account reached its configured billing threshold.
              "billing_threshold_reached"
            • //The account exhausted its credits without enabling pay-as-you-go.
              "pay_as_you_go_disabled"
            • //The account was blocked after repeated plan changes recycled credits.
              "upgrade_downgrade_abuse"
            • //Zoo support explicitly blocked the account.
              "admin"
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • prompt_id:

            stringUUID,
            //
          • seq:

            numberint32,
            //
          • :

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

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

                string,
                //
              • mimetype:

                string,
                //
              • name:

                string,
                //
              • :

                {{ ... },
                //
                • content_hash:

                  string,
                  //
                • index:

                  numberuint32,
                  //
                • prompt_id:

                  stringUUID,
                  //
                • seq:

                  numberint32
                  //
                }
              • :

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

                  string
                }
              }
            ]
          • role:

            "client"+1▾
            • //Client-authored input.
              "client"
            • //Server-authored message.
              "server"
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • detail:

            string,
            //
          • :

            [[ ... ],
            //
            • numberuint32
            ]
          • prompt_id:

            stringUUID,
            //
          • seq:

            numberint32
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • request_id:

            string
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • reason:

            string
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • arguments:

            ,
            //
          • catalog_revision:

            numberuint64,
            //
          • command_id:

            string,
            //
          • request_id:

            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,
                //
              • :

                {{ ... },
                //
                • content_hash:

                  string,
                  //
                • index:

                  numberuint32,
                  //
                • prompt_id:

                  stringUUID,
                  //
                • seq:

                  numberint32
                  //
                }
              • :

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

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

          {{ ... }
          • text:

            string
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • default_mode:

            string,
            //
          • :

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

                string,
                //
              • disabled:

                boolean,
                //
              • icon:

                string,
                //
              • id:

                string,
                //
              • label:

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

          {}
        }
      • //
        {
        • :

          {{ ... }
          • :

            {{ ... },
            //
            • :

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

            {{ ... }
            //
            • project_id:

              string,
              //
            • revision:

              string,
              //
            • writer_fence:

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

          {{ ... }
          • :

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

            string,
            //
          • :

            {{ ... },
            //
            • :

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

            {{ ... },
            //
            • project_id:

              string,
              //
            • revision:

              string,
              //
            • writer_fence:

              string
              //
            }
          • status:

            "accepted"+3▾
            • //The snapshot was based on current state and became canonical.
              "accepted"
            • //Non-overlapping client changes were merged into canonical state.
              "merged"
            • //A clean snapshot based on an older revision was not accepted.
              "rejected_stale"
            • //Client changes overlap canonical changes and require explicit resolution.
              "conflict"
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • :

            {{ ... }
            //
            • [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
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          //
          • :

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

            string,
            //
          • response_id:

            string
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • response_id:

            string
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          • call_id:

            string,
            //
          • output:

            string,
            //
          • output_truncated:

            boolean,
            //
          • project_updated:

            boolean,
            //
          • response_id:

            string,
            //
          • tool_name:

            string
            //
          }
        }
      • //
        {
        • :

          {{ ... }
          //
          • api_call_id:

            string,
            //
          • cache_write_input_tokens:

            numberint64,
            //
          • cached_input_tokens:

            numberint64,
            //
          • conversation_id:

            string,
            //
          • cost_micro_usd:

            numberint64,
            //
          • cost_usd:

            string,
            //
          • fully_priced:

            boolean,
            //
          • input_tokens:

            numberint64,
            //
          • output_tokens:

            numberint64,
            //
          • priced_requests:

            numberint64,
            //
          • reasoning_tokens:

            numberint64,
            //
          • requests:

            numberint64,
            //
          • schema_version:

            string,
            //
          • total_tokens:

            numberint64,
            //
          • uncached_input_tokens:

            numberint64,
            //
          • unpriced_requests:

            numberint64,
            //
          • :

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

                numberint64,
                //
              • cached_input_tokens:

                numberint64,
                //
              • cost_micro_usd:

                numberint64,
                //
              • cost_usd:

                string,
                //
              • fully_priced:

                boolean,
                //
              • input_tokens:

                numberint64,
                //
              • model:

                string,
                //
              • output_tokens:

                numberint64,
                //
              • priced_requests:

                numberint64,
                //
              • pricing_source:

                string,
                //
              • reasoning_tokens:

                numberint64,
                //
              • requests:

                numberint64,
                //
              • total_tokens:

                numberint64,
                //
              • uncached_input_tokens:

                numberint64,
                //
              • unpriced_requests:

                numberint64
                //
              }
            ]
          • :

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

                numberint64,
                //
              • cached_input_tokens:

                numberint64,
                //
              • cost_micro_usd:

                numberint64,
                //
              • cost_usd:

                string,
                //
              • fully_priced:

                boolean,
                //
              • input_tokens:

                numberint64,
                //
              • output_tokens:

                numberint64,
                //
              • priced_requests:

                numberint64,
                //
              • reasoning_tokens:

                numberint64,
                //
              • requests:

                numberint64,
                //
              • stage:

                string,
                //
              • total_tokens:

                numberint64,
                //
              • uncached_input_tokens:

                numberint64,
                //
              • unpriced_requests:

                numberint64
                //
              }
            ]
          }
        }
    }