LatentKit

Response Contract

Fields every successful LatentKit runtime response guarantees.

LatentKit normalizes successful runtime responses before returning them to your application. Log these fields on every production request.

{
  "id": "req_abc123",
  "provider": "anthropic",
  "model": "claude-sonnet-4-6",
  "policy_version_id": "pol_v_xyz789",
  "content": "Done.",
  "tool_calls": [],
  "content_blocks": [{ "type": "text", "text": "Done." }],
  "usage": {
    "input_tokens": 1234,
    "output_tokens": 567,
    "total_tokens": 1801
  },
  "cost_usd": 0.0123,
  "determinism": {
    "seed_requested": null,
    "seed_honored": false,
    "provider_supports_seed": true
  }
}

Guaranteed fields

FieldDescription
idLatentKit request ID. Same value as request_id and the X-LK-Request-ID response header.
providerUpstream backend that answered, such as openai, anthropic, xai, mistral, or openrouter.
modelResolved provider model identifier used for this request.
policy_version_idPublished routing policy version that handled the request.
usageNormalized token usage. input_tokens and output_tokens are always present; modality-specific fields (cached, image, reasoning tokens, audio seconds, audio characters, and video output units) may be zero or absent.
cost_usdComputed request cost in USD. BYOK and Platform Access may use different billing sources.
determinismSeed forwarding result — see Determinism.

Responses also include latency metadata (total_ms, and first_token_ms for streaming-capable providers) useful for performance dashboards.

LatentKit also returns legacy top-level usage aliases such as input_tokens, output_tokens, and total_tokens for compatibility. New integrations should prefer usage.

Tool and content output

tool_calls is always normalized to OpenAI-style function calls when the model produces tool use. content_blocks contains provider-normalized output blocks when available. Plain text is still available as content.

Debugging

When behavior changes, compare provider, model, and policy_version_id across requests before changing application code. Routing, model health, and policy edits can all affect output.

On this page