Skip to main content
POST
Chat Compare

Authorizations

Authorization
string
header
required

Enter your MeshAPI key (rsk_...) — sent as Authorization: Bearer <key>.

Headers

X-Mesh-Version
enum<string>
default:2026-08

Dated version of the API contract to pin this request to. Omit it and the request is served under 2026-08 — the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with 400 invalid_api_version rather than falling back silently. The version actually served is echoed as X-Mesh-Version on every response, including errors.

Available options:
2026-08

Body

application/json
models
string[]
required
Required array length: 1 - 10 elements
messages
Message · object[]
required
model_overrides
ModelOverride · object[] | null
comparison_model
string | null
comparison_instructions
string | null
temperature
number | null
Required range: 0 <= x <= 2
max_tokens
integer | null
Required range: x >= 1
stream
boolean
default:false
template
string | null
variables
Variables · object | null
skip_comparison
boolean
default:false
cache
boolean | null

Response

Per-model results plus an optional synthesized comparison (JSON), or an SSE stream when stream=true

comparison_id
string
required

Unique ID for this comparison (cmp_...).

created
integer
required

Unix timestamp (seconds) when the response was produced.

models
string[]
required

Models that were compared, in request order (deduped).

results
ModelCompareResult · object[]
required

Per-model results, in models order.

total_latency_ms
integer
required

End-to-end latency for the whole compare request, in milliseconds.

object
string
default:compare.completion
Allowed value: "compare.completion"
comparison
string | null

Synthesized evaluation of all responses from the comparison LLM. Null when skip_comparison is true or fewer than two models succeeded.

comparison_model
string | null

Model that produced comparison. Null when no synthesis ran.

comparison_usage
TokenUsage · object | null

Token usage for the comparison LLM call.

comparison_fallback_used
boolean
default:false

True if the primary comparison model failed and a fallback produced the synthesis.

partial
boolean
default:false

True if at least one model in results returned an error.

skip_comparison
boolean
default:false

Echoes whether the comparison LLM step was skipped.