Submit outcomes
POST /v1/models/{id}/outcomes
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 <= 64application/json- body
outcomes*array<>1 <= items <= 1000Success
application/json- response
accepted?integerpending_outcomes?integerunresolved?array<string>DeprecatedCompatibility field, always empty. Every outcome supplies its features; no request_id lookup is performed.
items <= 0refresh_triggered?booleanModel on auto_update: this batch started an integration.
refresh_suggested?booleanimport requestsurl = "https://api.spavik.co/v1/models/string/outcomes"body = """{ "outcomes": [ { "request_id": "req_4Nx7Bm2VtQd9Lp3Kwr", "features": { "plan": "pro", "seats": 12, "tickets_90d": 3 }, "actual": 1 }, { "features": { "plan": "free", "seats": 2, "tickets_90d": 10 }, "actual": 0 } ]}"""response = requests.request("POST", url, data = body, headers = { "Content-Type": "application/json"})print(response.text){ "accepted": 0, "pending_outcomes": 0, "unresolved": [], "refresh_triggered": true, "refresh_suggested": true}How is this guide?
Last updated on