Refresh a model
POST /v1/models/{id}/refresh
apiKeyX-Spavik-Api-Key<token>Spavik integration API key (sk-spv-api-...), sent in X-Spavik-Api-Key.
id*stringModel identifier or slug
Idempotency-Key?stringSame workspace, method, path, key and payload prevent another execution or charge, subject to current model access. Successful responses are replayed for every data policy, including ZDR, from the technical PostgreSQL cache (default retention 24 hours from operation creation). The data policy only controls inference input/output archiving to GCS/BigQuery; it never changes replay behavior. A different key or an expired completed key starts a new operation and may be charged again. REQUEST_IN_PROGRESS: wait Retry-After. REQUEST_INTERRUPTED: outcome uncertain; contact support. IDEMPOTENCY_RESPONSE_UNAVAILABLE: a completed response is missing; do not retry with a new key. Completed keys expire; unresolved keys remain protected. Reusing a key with different input returns 422. A key is required on the original call for safe retries.
User-Agent?stringInformation about the agent originating the request, when known. Browsers supply their own value. Optional diagnostic metadata, declared by the caller and never used for authorization. Omit unknown values. Values are trimmed and truncated to the documented length.
length <= 1024X-Spavik-Client-Name?stringHTTP caller: SDK, MCP server or direct application (for example spavik-sdk-python, spavik-sdk-javascript or spavik-mcp). Optional diagnostic metadata, declared by the caller and never used for authorization. Omit unknown values. Values are trimmed and truncated to the documented length.
length <= 128X-Spavik-Client-Version?stringVersion of that SDK, MCP server or direct application. Optional diagnostic metadata, declared by the caller and never used for authorization. Omit unknown values. Values are trimmed and truncated to the documented length.
length <= 64New version
application/json- response
model?version?outcomes_applied?integerincomplete_outcomes?integerOutcomes that were missing at least one column of the model: folded in with an empty value, but they teach less.
context_size?integerRows kept in the context after integration. The engine samples beyond its own limit, so this number can be lower than the sum of the rows sent.
import requestsurl = "https://api.spavik.co/v1/models/string/refresh"response = requests.request("POST", url)print(response.text){ "model": { "id": "string", "name": "string", "slug": "string", "engine_family": "flair", "target": "string", "task": "classification", "engine": "string", "feature_columns": [ "string" ], "status": "string", "auto_update": true, "retain_outcomes": true, "latest_version": 0, "created_at": "2019-08-24T14:15:22Z" }, "version": { "id": "string", "version": 0, "status": "string", "target": "string", "task": "string", "n_train": 0, "n_sampled_from": 0, "metrics": { "AUC": 0, "Accuracy": 0, "AveragePrecision": 0, "LogLoss": 0, "MacroF1": 0, "MAE": 0, "RMSE": 0, "R²": 0, "MASE": 0, "Bias": 0, "BiasRatio": 0, "Pinball": 0, "property1": 0, "property2": 0 }, "baselines": {}, "classification_report": { "evaluated_count": 0, "decision_rule": { "kind": "argmax", "description": "string", "class_order": [ "string" ], "threshold": 0, "tie_break": "first_in_class_order" }, "per_class": [ { "class": "string", "support": 0, "predicted_count": 0, "true_positive": 0, "precision": 0, "recall": 0, "f1": 0, "undefined_reasons": { "precision": "no_predicted_samples", "recall": "no_actual_samples", "f1": "no_actual_or_predicted_samples" } } ] }, "calibration": { "available": true, "unavailable_reason": "no_evaluated_samples", "evaluated_count": 0, "evaluated_on": "test", "kind": "one_vs_rest", "interpretation": "descriptive_only", "binning": "uniform", "n_bins": 10, "bin_boundaries": "left_closed_right_open_last_closed", "per_class": [ { "class": "string", "bins": [ { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 }, { "lower": 0, "upper": 0, "count": 0, "positive_count": 0, "mean_predicted_probability": 0, "observed_frequency": 0 } ] } ] }, "evaluation": { "metric_context": { "undefined_reasons": { "property1": "string", "property2": "string" }, "class_order": [ "string" ], "positive_class": "string", "auc_average": "binary", "average_precision_method": "non_interpolated", "macro_f1_average": "unweighted_defined_classes", "log_loss_epsilon": 0 } }, "warnings": [ "string" ], "top_factors": [ {} ], "engine": "string" }, "outcomes_applied": 0, "incomplete_outcomes": 0, "context_size": 0}How is this guide?
Last updated on