Eval runs

Mint a model lease for MCPJam-hosted inference

How an SDK eval running OUTSIDE the platform (local dev, CI) uses MCPJam-hosted inference on the organization's credits, with no provider key of its own. Authenticate like any other /api/v1 route (typically an sk_ key).

The lease is strictly narrower than the key used to get it: one organization, one project, one model, one proxy host, about 30 minutes, a per-lease spend and call cap, and revocable by runId.

The {projectId} segment declares which project's organization pays, and always wins over any projectId in the body. The literal default resolves to the key org's Default project — the zero-config CI case, and the same resolution the eval-ingest routes use, so a lease and the results it produces land in the same project.

post/projects/{projectId}/model-leases

Path parameters

projectIdstring required

Project id, or the literal default for the key org's Default project.

Request body

modelstring required

Canonical model id. Only anthropic/claude-* and openai/gpt-5* are served, and only if the model has a gateway pricing row.

runIdstring

Caller-chosen id to revoke by. Generated if omitted.

maxOutputTokensinteger

Per-call output ceiling, clamped to the server maximum.

Example request

{
  "model": "anthropic/claude-sonnet-4.5"
}

Response

A short-lived lease and the proxy to present it to.

leasestring required

Present it as the x-mcpjam-harness-lease header on requests to proxyBaseUrl. Never as a bearer token, and never sent to any other host.

protocol'anthropic' | 'openai' required

Which vendor wire format proxyBaseUrl speaks, derived from the model's vendor prefix.

proxyBaseUrlstring uri required

Base URL for the metered model proxy. Anthropic leases accept POST /v1/messages; OpenAI leases accept POST /v1/responses.

expiresAtinteger required

Epoch milliseconds. Mint a new lease before this; the proxy fails an expired one closed.

runIdstring required

Pass to the revoke operation to kill this lease early.

modelstring required

Changes

Changed in 1 of the 122 revisions of this API.1