✓ PASS

vercel-ai 7.0.153

usage.cached-tokens · openai-chat

Back to results · Scenario

Requirements

IdLevelStatusEvidence
total-reconcilesMUSTSATISFIEDusage.total=1126 (primary); truth.usage.total=1126
cached-input-reportedSHOULDSATISFIEDusage.cached_input=1080 (primary); truth.usage.cached_input=1080

What the provider sent

Finish
stop
Raw finish
stop
Text
A hot pan helps mushrooms brown instead of releasing water and turning soggy. Heat the pan first, then add the mushrooms in a single layer; if they crowd the pan, cook them in batches.
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": 1080,
  "input": 1083,
  "output": 43,
  "raw": {
    "completion_tokens": 43,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens": 1083,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cache_write_tokens": 0,
      "cached_tokens": 1080
    },
    "total_tokens": 1126
  },
  "reasoning": 0,
  "total": 1126
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "chatcmpl-Ei7jsQ8otN5546zOgRwUVUiVE7g9K",
  "object": "chat.completion",
  "created": 1794184888,
  "model": "gpt-6-luna",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "A hot pan helps mushrooms brown instead of releasing water and turning soggy. Heat the pan first, then add the mushrooms in a single layer; if they crowd the pan, cook them in batches.",
        "refusal": null,
        "annotations": []
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1083,
    "completion_tokens": 43,
    "total_tokens": 1126,
    "prompt_tokens_details": {
      "cached_tokens": 1080,
      "cache_write_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "service_tier": "default",
  "system_fingerprint": null
}

What the library reported

Outcome
returned
Finish
{
  "raw": "stop",
  "source": "result.finishReason",
  "surface": "primary",
  "value": "stop"
}
Text
Value
A hot pan helps mushrooms brown instead of releasing water and turning soggy. Heat the pan first, then add the mushrooms in a single layer; if they crowd the pan, cook them in batches.
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 1080,
  "input": 1083,
  "output": 43,
  "reasoning": 0,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 1126
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 103.404717,
  "error": null,
  "finish": {
    "raw": "stop",
    "source": "result.finishReason",
    "surface": "primary",
    "value": "stop"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "generateText",
    "language": "javascript",
    "name": "vercel-ai",
    "version": "7.0.153"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": null,
    "completed": null,
    "used": false
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "A hot pan helps mushrooms brown instead of releasing water and turning soggy. Heat the pan first, then add the mushrooms in a single layer; if they crowd the pan, cook them in batches."
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 1080,
    "input": 1083,
    "output": 43,
    "reasoning": 0,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 1126
  }
}

Fixture

recorded openai-chat/usage.cached-tokens

ProvenanceValue
Recorded at2026-11-09T00:41:27Z
Requested modelgpt-6-luna
Returned modelgpt-6-luna
CI runhttps://github.com/kartsan03/wiretruth/actions/runs/42541525617

Reproduce

wiretruth serve openai-chat/usage.cached-tokens

Plain-library snippet from the shim manifest.

createOpenAI({ baseURL: WIRETRUTH_BASE_URL_OPENAI_CHAT, apiKey }).chat(model)

Upstream

No matching upstream report.

History

VersionGrade
7.0.153✓ PASS
7.0.146not covered
7.0.142not covered