API reference

Docs

task-models.com is an OpenAI- and Anthropic-compatible endpoint for long-running economic work. Point any SDK at https://task-models.com/v1, use a key from your dashboard, and pick a model. The stream field is still named mergemodels.

Models

ModelWhat runsBilled at
mergeDeepSeek V4.1 Flash starts the task. Continuation, a controlled abliterated model, finishes it only when a benign task stops earlyone spot: input and output
merge-fastDeepSeek V4.1 Flash only. A stop stays a stopone spot
merge-proThe controlled abliterated model from the first tokencontinuation rates

Continuation is a controlled abliterated model. Abliteration means its refusal behavior is reduced, so it can finish ordinary work that the official model stopped. Control means this gateway decides when it runs: only after the task check calls the request benign. A serious or unclear request never reaches it.

default and auto are aliases of merge. GET /v1/models lists them.

Quickstart

curl

curl https://task-models.com/v1/chat/completions \
  -H "Authorization: Bearer $MM_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "merge", "stream": true, "reasoning_effort": "high",
       "messages": [{"role": "user", "content": "Write a 90-day operating plan for a three-person logistics desk, with weekly milestones."}]}'

Python, OpenAI SDK

import os
from openai import OpenAI

client = OpenAI(base_url="https://task-models.com/v1", api_key=os.environ["MM_API_KEY"])
stream = client.chat.completions.create(
    model="merge", stream=True,
    messages=[{"role": "user", "content": "Compare three freight lanes for a regional distributor and recommend one."}],
    extra_body={"mergemodels": {"debug": True}},
)
for chunk in stream:
    extra = chunk.model_extra or {}
    if "mergemodels" in extra and extra["mergemodels"]["event"] == "swap":
        print(f"\n[swapped to {extra['mergemodels']['to']['label']}: {extra['mergemodels']['trigger']}]")
    for choice in chunk.choices:
        print(choice.delta.content or "", end="", flush=True)

Anthropic Messages

curl https://task-models.com/v1/messages \
  -H "x-api-key: $MM_API_KEY" -H "anthropic-version: 2023-06-01" -H "Content-Type: application/json" \
  -d '{"model": "merge", "max_tokens": 4096, "messages": [{"role": "user", "content": "..."}]}'

Claude Code works too: ANTHROPIC_BASE_URL=https://task-models.com, ANTHROPIC_AUTH_TOKEN=$MM_API_KEY, ANTHROPIC_MODEL=merge.

How a continuation looks in the stream

A continuation never breaks a client: text keeps arriving in the same delta.content / delta.reasoning_content fields. For clients that want to know, the OpenAI stream carries one extra chunk at the swap point, with an empty delta and a mergemodels object:

{"id": "chatcmpl-…", "object": "chat.completion.chunk", "model": "merge",
 "choices": [{"index": 0, "delta": {}, "finish_reason": null}],
 "mergemodels": {"event": "swap", "trigger": "false_refusal", "confidence": 0.91,
                 "harm": "benign", "reason": "refusal of a benign request", "source": "classifier",
                 "phase": "content", "at_tokens": 40,
                 "from": {"model": "deepseek/deepseek-v4.1-flash", "label": "DeepSeek V4.1 Flash"},
                 "to":   {"model": "abliterated-model", "label": "Continuation"}}}
  • phase: request (before any output), reasoning or content: where the official model was when the task stopped.
  • harm is benign when the task continues. source is classifier, or upstream_error when the continuation failed and the official model finished the answer.
  • The chunk with finish_reason carries "mergemodels": {"event": "summary", …}: segments, swaps, checks and the cost in USD. Usage includes cost.
  • Non-streaming responses carry the same summary as a top-level mergemodels field, plus an x-mergemodels-swapped header.
  • Anthropic streams send these as SSE comment lines (: mergemodels {…}), which SDKs ignore.

Request options

mergemodels.triggers
Accepted and ignored. A client cannot turn the harm check off or add a reason to continue.
mergemodels.debug
true also streams the task-check verdict ("event": "check") and each model start ("event": "segment").
reasoning_effort
none · low · medium · high · xhigh · max, passed to whichever model is serving. Anthropic clients: output_config.effort.
max_tokens
Caps reasoning and answer together, across both models. Default 32,768, maximum 65,536.
also
tools, tool_choice, response_format, temperature, top_p, stop, seed, and a trailing assistant message as a prefill.

When a long task continues

The official draft is held when it looks like an early stop. Continuation, a controlled abliterated model, runs only when the classifier says that draft stopped the work and the request is benign. The threshold is 0.6. Serious, unclear, a classifier error, and a timeout stay on the official model.

Serious means concrete help with: sexual content involving anyone under 18; a violent crime; explosives or chemical, biological, or nuclear weapons; a pathogen or toxin; offensive cyber (exploits, malware, unauthorized access, credential theft); fraud, scams, or phishing; a method for self-harm.

Benign is ordinary economic work and other over-stopped tasks: research, analysis, operations, planning, coding, writing, adult sexual content between adults, general medical or legal information, and security concepts with no attack procedure.

Spot price and billing

The price changes with the market. GET /v1/pricing returns the live price (no key needed); GET /v1/pricing/history lists recent changes.

{"object": "spot_price", "id": 1, "currency": "usd", "unit": "1M tokens",
 "prices": {"input": 0.42, "cached_input": 0.042, "output": 1.68,
            "advanced_input": 1.47, "advanced_output": 4.41}}
  • A request is billed at the spot price that was live when it started.
  • On merge and merge-fast, your prompt is billed once at input (cached tokens at cached_input) and every token delivered to you is billed at output. A continuation does not add a second price.
  • advanced_input and advanced_output are the merge-pro rates, for calling the controlled abliterated model from the first token.
  • Failed requests are free. If you disconnect, you pay for what was delivered until then. An early stop that a continuation replaces is not delivered and is not billed.

Watching requests

GET /v1/live lists your in-flight requests; GET /v1/live/<id> is an SSE stream of one of them: reasoning, answer, every classifier verdict and the swap, as they happen. The dashboard shows the same view.

Errors

401
Missing or invalid API key.
402
Balance too low; top up on the dashboard.
429
Too many concurrent requests (8 per account).
400
The request was rejected (by us or by both upstream models).
502
The official model failed, or the continuation failed and the official model failed too. An official failure does not start the controlled abliterated model.