upload_hosted_model_version
Upload a model trained anywhere as a new version of a hosted model: the ONNX file as base64 (at most 4 MiB) and the spec that maps request fields to its inputs. It is checked before it is stored: it must parse, use only operators the hosted runtime runs (scikit-learn, XGBoost and LightGBM tree ensembles, linear models, small neural networks), take as many inputs as the spec lists, and give a finite answer of the right shape on a test row; otherwise it answers 422 naming the problem. Stored as a candidate unless promote is true. The hosted MCP endpoint (/api/mcp/rpc) takes requests of at most 64 KiB, so send a larger file with the stdio server, the tool packages or POST /api/hosted-models/{model_id}/versions. Answers 404 not_released while hosted models (the hosted-pricing-models release) are not switched on for your workspace. Needs a Last Price credential with function publish scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | How request fields become the model's inputs. | |
| notes | No | Optional notes kept with the version. | |
| promote | No | Make it the active version at once. Defaults to false: stored as a candidate. | |
| model_id | Yes | The hosted model's id: id on a list_hosted_models result. | |
| artifact_base64 | Yes | The .onnx file, base64 encoded. At most 4 MiB before encoding. |