litellm/tests/integration/cost_calculation/cases/azure.py
devin-ai-integration[bot] cd20ecace1
test(cost): add tier 1 cost tracking cells and sync usage shapes for 2026-10-17 (#47141)
* test(cost): add tier 1 cost tracking cells and sync usage shapes for 2026-10-17

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(cost): restore tiered cost cases and revert out of scope usage edits

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(cost): add remaining tier 1 endpoint cells for 2026-10-17

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-17 11:11:46 -07:00

6089 lines
236 KiB
Python

"""azure cost tracking cases, one CostTrackingTestCase literal per request shape (moved from cost_tracking_cases.json).
PARITY pairs the streamed case with its plain twin where both bill the same row."""
from typing import Final, cast
from integration.cost_calculation.cost_tracking_case import (
with_response_usage,
with_usage,
BinaryResponse,
CostTrackingTestCase,
Deployment,
ExactExpected,
FailureDetails,
FailureExpected,
JsonResponse,
RecountExpected,
RecountRates,
SseResponse,
WavUpload,
)
from integration.cost_calculation.bridge_cost_parity.case import BridgeCostParityTestCase, bridge_pairs
from integration.cost_calculation.stream_parity.case import StreamParityTestCase, sse_frames
from integration.cost_calculation.cases.openai import _responses_json_body, _responses_stream_case
from pydantic import JsonValue
def _response_for_model(
response: JsonResponse, model: str, *, service_tier: str | None = None
) -> JsonResponse:
return response.model_copy(
update={
"body": {
**response.body,
"model": model,
**({"service_tier": service_tier} if service_tier is not None else {}),
}
}
)
def _stream_for_model(response: SseResponse, model: str) -> SseResponse:
return response.model_copy(
update={
"frames": tuple(
frame.replace("gpt-6-luna-2026-09-22", model).replace("gpt-6-luna", model) for frame in response.frames
)
}
)
def _azure_responses_json_case(
base: CostTrackingTestCase, name: str, response_model: str, content_filters: JsonValue
) -> CostTrackingTestCase:
response_case: Final = bridge_pairs((base,), ("/v1/responses",))[0].bridged
return response_case.model_copy(
update={
"name": name,
"response": JsonResponse(
content_type="application/json",
body=_responses_json_body(
response_model,
include_content_filters=True,
content_filters=content_filters,
),
),
}
)
def _azure_messages_stream_case(
messages_json: CostTrackingTestCase, stream_case: CostTrackingTestCase, name: str
) -> CostTrackingTestCase:
return messages_json.model_copy(
update={
"name": name,
"request": {**messages_json.request, "stream": True},
"response": stream_case.response,
}
)
# azure/gpt-5.4-mini
AZURE_GPT_5_4_MINI_INPUT_TEXT: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-input_text",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "28b0c4ce80d6 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788217,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 28b0c4ce80d6"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_CACHE_READ: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-cache_read",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "33fdcb306184 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 33fdcb306184"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 12928,
"completion_tokens": 380,
"total_tokens": 13308,
"prompt_tokens_details": {"cached_tokens": 12288},
},
},
),
expected=ExactExpected(
spend=0.001767168, input_cost=0.000672768, output_cost=0.0010944, prompt_tokens=12928, completion_tokens=380
),
)
AZURE_GPT_5_4_MINI_AUDIO_INPUT: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-audio_input",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "28a136ca9579 summarize the attached material in one line and name the city weather",
},
{
"type": "input_audio",
"input_audio": {
"data": "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",
"format": "wav",
},
},
],
},
],
"stream": False,
"modalities": ["text"],
"allowed_openai_params": ["modalities"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788220,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 28a136ca9579"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 1546,
"completion_tokens": 210,
"total_tokens": 1756,
"prompt_tokens_details": {"audio_tokens": 1450},
},
},
),
expected=ExactExpected(
spend=0.01586436, input_cost=0.01525956, output_cost=0.0006048, prompt_tokens=1546, completion_tokens=210
),
)
AZURE_GPT_5_4_MINI_AUDIO_OUTPUT: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-audio_output",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "2bebbaa4e254 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"modalities": ["text", "audio"],
"audio": {"voice": "alloy", "format": "pcm16"},
"allowed_openai_params": ["modalities", "audio"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788222,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 2bebbaa4e254"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 220,
"completion_tokens": 1300,
"total_tokens": 1520,
"completion_tokens_details": {"audio_tokens": 1120},
},
},
),
expected=ExactExpected(
spend=0.0241176, input_cost=7.92e-05, output_cost=0.0240384, prompt_tokens=220, completion_tokens=1300
),
)
AZURE_GPT_5_4_MINI_REASONING: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-reasoning",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "6af41b14ef04 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"reasoning_effort": "medium",
"allowed_openai_params": ["reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788222,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 6af41b14ef04"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 1240,
"completion_tokens": 4040,
"total_tokens": 5280,
"completion_tokens_details": {"reasoning_tokens": 3480},
},
},
),
expected=ExactExpected(
spend=0.0135432, input_cost=0.0004464, output_cost=0.0130968, prompt_tokens=1240, completion_tokens=4040
),
)
AZURE_GPT_5_4_MINI_SERVICE_TIER_FLEX: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-service_tier_flex",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "60a03b8b6237 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"service_tier": "flex",
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 60a03b8b6237"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
"service_tier": "flex",
},
),
expected=ExactExpected(
spend=0.00092448, input_cost=0.0003312, output_cost=0.00059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_SERVICE_TIER_PRIORITY: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-service_tier_priority",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "3922bd062f4a summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"service_tier": "priority",
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788226,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 3922bd062f4a"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
"service_tier": "priority",
},
),
expected=ExactExpected(
spend=0.00369792, input_cost=0.0013248, output_cost=0.00237312, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_WEB_SEARCH_MEDIUM: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-web_search_medium",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "26430574f63b summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"web_search_options": {"search_context_size": "medium"},
"allowed_openai_params": ["web_search_options"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788211,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "scripted answer 26430574f63b",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
},
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
},
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
},
],
},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.01434896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_WEB_SEARCH_LOW: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-web_search_low",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "5792eab53e4c summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"web_search_options": {"search_context_size": "low"},
"allowed_openai_params": ["web_search_options"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788213,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "scripted answer 5792eab53e4c",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
}
],
},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.01184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_WEB_SEARCH_HIGH: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-web_search_high",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "7a7fc7488611 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"web_search_options": {"search_context_size": "high"},
"allowed_openai_params": ["web_search_options"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788215,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "scripted answer 7a7fc7488611",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
}
],
},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.01684896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_STREAM: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "35a730eefc00 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer 35a730eefc00"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "cc-pinned-deployment",
"choices": [],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
done=True,
),
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_STREAM_NO_USAGE: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream_no_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "969d5ff8918e summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788216,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788216,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer 969d5ff8918e"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788216,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
done=True,
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=3.6e-07, output_cost_per_token=2.88e-06)),
)
AZURE_GPT_5_4_MINI_STREAM_NO_USAGE_TOOL_CALL: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream_no_usage_tool_call",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "db6294a8264b summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"allowed_openai_params": ["tool_choice"],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"tool_calls": [
{
"index": 0,
"id": "call_$REQUEST_ID",
"type": "function",
"function": {"name": "get_weather", "arguments": ""},
}
],
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"tool_calls": [
{
"index": 0,
"function": {
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler fil'
},
}
]
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"tool_calls": [
{
"index": 0,
"function": {
"arguments": "ler filler filler filler filler filler filler filler filler filler filler filler filler fi"
},
}
]
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"tool_calls": [
{
"index": 0,
"function": {
"arguments": 'ller filler filler filler filler filler filler filler filler filler filler filler filler "}'
},
}
]
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {}, "finish_reason": "tool_calls"}],
"usage": None,
},
done=True,
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=3.6e-07, output_cost_per_token=2.88e-06)),
)
AZURE_GPT_5_4_MINI_STREAM_NO_USAGE_IMAGE_INPUT: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream_no_usage_image_input",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "524f8c567f64 summarize the attached material in one line and name the city weather",
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,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",
"detail": "high",
},
},
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788220,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788220,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer 524f8c567f64"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788220,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
done=True,
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=3.6e-07, output_cost_per_token=2.88e-06)),
)
AZURE_GPT_5_4_MINI_RESPONSE_MODEL_OVERRIDE: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-response_model_override",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "109128998398 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 109128998398"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_STREAM_RESPONSE_MODEL_OVERRIDE: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream_response_model_override",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "e5bffdbd65e2 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer e5bffdbd65e2"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
done=True,
),
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_TOOL_CALL: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-tool_call",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "75003151c7de summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"allowed_openai_params": ["tool_choice"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788223,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": None,
"tool_calls": [
{
"id": "call_$REQUEST_ID",
"type": "function",
"function": {
"name": "get_weather",
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
},
}
],
},
"finish_reason": "tool_calls",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_STREAM_TOOL_CALL: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream_tool_call",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "e3e7c45697d3 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"allowed_openai_params": ["tool_choice"],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"tool_calls": [
{
"index": 0,
"id": "call_$REQUEST_ID",
"type": "function",
"function": {"name": "get_weather", "arguments": ""},
}
],
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"tool_calls": [
{
"index": 0,
"function": {
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler fil'
},
}
]
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"tool_calls": [
{
"index": 0,
"function": {
"arguments": "ler filler filler filler filler filler filler filler filler filler filler filler filler fi"
},
}
]
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {
"tool_calls": [
{
"index": 0,
"function": {
"arguments": 'ller filler filler filler filler filler filler filler filler filler filler filler filler "}'
},
}
]
},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {}, "finish_reason": "tool_calls"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788225,
"model": "cc-pinned-deployment",
"choices": [],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
done=True,
),
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_4_MINI_STREAM_FULL_USAGE: Final = CostTrackingTestCase(
name="azure-gpt-5.4-mini-stream_full_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "906fb0b08ba9 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "cc-pinned-deployment",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer 906fb0b08ba9"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "cc-pinned-deployment",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "cc-pinned-deployment",
"choices": [],
"usage": {
"prompt_tokens": 8314,
"completion_tokens": 1592,
"total_tokens": 9906,
"prompt_tokens_details": {"cached_tokens": 6144, "audio_tokens": 330},
"completion_tokens_details": {"reasoning_tokens": 900, "audio_tokens": 280},
},
},
done=True,
),
),
expected=ExactExpected(
spend=0.014385144, input_cost=0.004348584, output_cost=0.01003656, prompt_tokens=8314, completion_tokens=1592
),
)
AZURE_PINNED_GPT_5_4_MINI_STREAM: Final = CostTrackingTestCase(
name="azure-pinned-gpt-5.4-mini-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.4-mini",
deployment=Deployment(model="azure/cc-pinned-deployment", base_model="azure/gpt-5.4-mini"),
request={
"model": "$MODEL",
"messages": [{"role": "user", "content": "azure-pinned-gpt-5.4-mini-stream"}],
"stream": True,
},
response=SseResponse(
content_type="text/event-stream",
frames=(
'data: {"id":"chatcmpl-$REQUEST_ID","object":"chat.completion.chunk","created":1,"model":"$MODEL","choices":[{"index":0,"delta":{"role":"assistant","content":"ok"},"finish_reason":null}]}\n\n',
'data: {"id":"chatcmpl-$REQUEST_ID","object":"chat.completion.chunk","created":1,"model":"$MODEL","choices":[],"usage":{"prompt_tokens":1840,"completion_tokens":412,"total_tokens":2252}}\n\n',
"data: [DONE]\n\n",
),
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
# azure/gpt-5.6
AZURE_GPT_5_6_INPUT_TEXT: Final = CostTrackingTestCase(
name="azure-gpt-5.6-input_text",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "7dc90bf2ab07 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788212,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 7dc90bf2ab07"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.0092448, input_cost=0.003312, output_cost=0.0059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_CACHE_READ: Final = CostTrackingTestCase(
name="azure-gpt-5.6-cache_read",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "c84b90d4fd99 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788214,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer c84b90d4fd99"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 12928,
"completion_tokens": 380,
"total_tokens": 13308,
"prompt_tokens_details": {"cached_tokens": 12288},
},
},
),
expected=ExactExpected(
spend=0.00883584, input_cost=0.00336384, output_cost=0.005472, prompt_tokens=12928, completion_tokens=380
),
)
AZURE_GPT_5_6_AUDIO_INPUT: Final = CostTrackingTestCase(
name="azure-gpt-5.6-audio_input",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "1744b6a5bab3 summarize the attached material in one line and name the city weather",
},
{
"type": "input_audio",
"input_audio": {
"data": "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",
"format": "wav",
},
},
],
},
],
"stream": False,
"modalities": ["text"],
"allowed_openai_params": ["modalities"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788215,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 1744b6a5bab3"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 1546,
"completion_tokens": 210,
"total_tokens": 1756,
"prompt_tokens_details": {"audio_tokens": 1450},
},
},
),
expected=ExactExpected(
spend=0.0626468, input_cost=0.0596228, output_cost=0.003024, prompt_tokens=1546, completion_tokens=210
),
)
AZURE_GPT_5_6_AUDIO_OUTPUT: Final = CostTrackingTestCase(
name="azure-gpt-5.6-audio_output",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "dfb52830c629 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"modalities": ["text", "audio"],
"audio": {"voice": "alloy", "format": "pcm16"},
"allowed_openai_params": ["modalities", "audio"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788217,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer dfb52830c629"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 220,
"completion_tokens": 1300,
"total_tokens": 1520,
"completion_tokens_details": {"audio_tokens": 1120},
},
},
),
expected=ExactExpected(
spend=0.094828, input_cost=0.000396, output_cost=0.094432, prompt_tokens=220, completion_tokens=1300
),
)
AZURE_GPT_5_6_REASONING: Final = CostTrackingTestCase(
name="azure-gpt-5.6-reasoning",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "5c6865969ae9 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"reasoning_effort": "medium",
"allowed_openai_params": ["reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788218,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 5c6865969ae9"},
"finish_reason": "stop",
}
],
"usage": {
"prompt_tokens": 1240,
"completion_tokens": 4040,
"total_tokens": 5280,
"completion_tokens_details": {"reasoning_tokens": 3480},
},
},
),
expected=ExactExpected(
spend=0.067716,
input_cost=0.002232,
output_cost=0.065484,
prompt_tokens=1240,
completion_tokens=4040,
reasoning_cost=0.05742,
),
)
AZURE_GPT_5_6_SERVICE_TIER_FLEX: Final = CostTrackingTestCase(
name="azure-gpt-5.6-service_tier_flex",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "b67dcd189cdd summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"service_tier": "flex",
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer b67dcd189cdd"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
"service_tier": "flex",
},
),
expected=ExactExpected(
spend=0.0046224, input_cost=0.001656, output_cost=0.0029664, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_SERVICE_TIER_PRIORITY: Final = CostTrackingTestCase(
name="azure-gpt-5.6-service_tier_priority",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "01c77d1ef23d summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"service_tier": "priority",
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788222,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 01c77d1ef23d"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
"service_tier": "priority",
},
),
expected=ExactExpected(
spend=0.0184896, input_cost=0.006624, output_cost=0.0118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_WEB_SEARCH_MEDIUM: Final = CostTrackingTestCase(
name="azure-gpt-5.6-web_search_medium",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "d4efeea706ac summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"web_search_options": {"search_context_size": "medium"},
"allowed_openai_params": ["web_search_options"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788222,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "scripted answer d4efeea706ac",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
},
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
},
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
},
],
},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.0217448,
input_cost=0.003312,
output_cost=0.0059328,
prompt_tokens=1840,
completion_tokens=412,
tool_usage_cost=0.0125,
),
)
AZURE_GPT_5_6_WEB_SEARCH_LOW: Final = CostTrackingTestCase(
name="azure-gpt-5.6-web_search_low",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "73458bfd2358 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"web_search_options": {"search_context_size": "low"},
"allowed_openai_params": ["web_search_options"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788225,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "scripted answer 73458bfd2358",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
}
],
},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.0192448, input_cost=0.003312, output_cost=0.0059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_WEB_SEARCH_HIGH: Final = CostTrackingTestCase(
name="azure-gpt-5.6-web_search_high",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "0aebd59315f2 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"web_search_options": {"search_context_size": "high"},
"allowed_openai_params": ["web_search_options"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788226,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "scripted answer 0aebd59315f2",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"url": "https://scripted.example/source",
"title": "scripted source",
"start_index": 0,
"end_index": 1,
},
}
],
},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.0242448, input_cost=0.003312, output_cost=0.0059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_STREAM: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "9df3f46fd138 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer 9df3f46fd138"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788211,
"model": "gpt-5.6",
"choices": [],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
done=True,
),
),
expected=ExactExpected(
spend=0.0092448, input_cost=0.003312, output_cost=0.0059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_STREAM_NO_USAGE: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream_no_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "b54d5959e61f summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788213,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788213,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer b54d5959e61f"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788213,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
done=True,
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=1.8e-06, output_cost_per_token=1.44e-05)),
)
AZURE_GPT_5_6_STREAM_NO_USAGE_TOOL_CALL: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream_no_usage_tool_call",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "23eb3226fc23 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"allowed_openai_params": ["tool_choice"],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"type": "response.created",
"response": {
"id": "resp_$REQUEST_ID",
"object": "response",
"created_at": 1789788215,
"model": "gpt-5.6",
"output": [
{
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
"status": "completed",
}
],
"status": "in_progress",
"usage": None,
},
},
{
"type": "response.output_item.added",
"output_index": 0,
"item": {
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": "",
"status": "in_progress",
},
},
{
"type": "response.function_call_arguments.delta",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"delta": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler fil',
},
{
"type": "response.function_call_arguments.delta",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"delta": "ler filler filler filler filler filler filler filler filler filler filler filler filler fi",
},
{
"type": "response.function_call_arguments.delta",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"delta": 'ller filler filler filler filler filler filler filler filler filler filler filler filler "}',
},
{
"type": "response.function_call_arguments.done",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
},
{
"type": "response.completed",
"response": {
"id": "resp_$REQUEST_ID",
"object": "response",
"created_at": 1789788215,
"status": "completed",
"model": "gpt-5.6",
"output": [
{
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
"status": "completed",
}
],
},
},
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=1.8e-06, output_cost_per_token=1.44e-05)),
)
AZURE_GPT_5_6_STREAM_NO_USAGE_IMAGE_INPUT: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream_no_usage_image_input",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "fb83549ab4c5 summarize the attached material in one line and name the city weather",
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,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",
"detail": "high",
},
},
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer fb83549ab4c5"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788215,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
done=True,
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=1.8e-06, output_cost_per_token=1.44e-05)),
)
AZURE_GPT_5_6_RESPONSE_MODEL_OVERRIDE: Final = CostTrackingTestCase(
name="azure-gpt-5.6-response_model_override",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "74e949a94e0f summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion",
"created": 1789788216,
"model": "gpt-5.4-mini",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "scripted answer 74e949a94e0f"},
"finish_reason": "stop",
}
],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_STREAM_RESPONSE_MODEL_OVERRIDE: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream_response_model_override",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "af89dddadd12 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "gpt-5.4-mini",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "gpt-5.4-mini",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer af89dddadd12"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "gpt-5.4-mini",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788218,
"model": "gpt-5.4-mini",
"choices": [],
"usage": {"prompt_tokens": 1840, "completion_tokens": 412, "total_tokens": 2252},
},
done=True,
),
),
expected=ExactExpected(
spend=0.00184896, input_cost=0.0006624, output_cost=0.00118656, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_TOOL_CALL: Final = CostTrackingTestCase(
name="azure-gpt-5.6-tool_call",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "30d4deb9b74f summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"allowed_openai_params": ["tool_choice"],
},
response=JsonResponse(
content_type="application/json",
body={
"id": "resp_$REQUEST_ID",
"object": "response",
"created_at": 1789788220,
"status": "completed",
"model": "gpt-5.6",
"output": [
{
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
"status": "completed",
}
],
"usage": {"input_tokens": 1840, "output_tokens": 412, "total_tokens": 2252},
},
),
expected=ExactExpected(
spend=0.0092448, input_cost=0.003312, output_cost=0.0059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_STREAM_TOOL_CALL: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream_tool_call",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "ef44a3525238 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"allowed_openai_params": ["tool_choice"],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"type": "response.created",
"response": {
"id": "resp_$REQUEST_ID",
"object": "response",
"created_at": 1789788221,
"model": "gpt-5.6",
"output": [
{
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
"status": "completed",
}
],
"status": "in_progress",
"usage": None,
},
},
{
"type": "response.output_item.added",
"output_index": 0,
"item": {
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": "",
"status": "in_progress",
},
},
{
"type": "response.function_call_arguments.delta",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"delta": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler fil',
},
{
"type": "response.function_call_arguments.delta",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"delta": "ler filler filler filler filler filler filler filler filler filler filler filler filler fi",
},
{
"type": "response.function_call_arguments.delta",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"delta": 'ller filler filler filler filler filler filler filler filler filler filler filler filler "}',
},
{
"type": "response.function_call_arguments.done",
"item_id": "fc_$REQUEST_ID",
"output_index": 0,
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
},
{
"type": "response.completed",
"response": {
"id": "resp_$REQUEST_ID",
"object": "response",
"created_at": 1789788221,
"status": "completed",
"model": "gpt-5.6",
"output": [
{
"type": "function_call",
"id": "fc_$REQUEST_ID",
"call_id": "call_$REQUEST_ID",
"name": "get_weather",
"arguments": '{"city": "Berlin", "days": 7, "units": "metric", "notes": "filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler filler "}',
"status": "completed",
}
],
"usage": {"input_tokens": 1840, "output_tokens": 412, "total_tokens": 2252},
},
},
),
),
expected=ExactExpected(
spend=0.0092448, input_cost=0.003312, output_cost=0.0059328, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_5_6_STREAM_FULL_USAGE: Final = CostTrackingTestCase(
name="azure-gpt-5.6-stream_full_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-5.6",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "e440709770ad summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {"role": "assistant"}, "finish_reason": None}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "scripted answer e440709770ad"},
"finish_reason": None,
}
],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}],
"usage": None,
},
{
"id": "chatcmpl-$REQUEST_ID",
"object": "chat.completion.chunk",
"created": 1789788221,
"model": "gpt-5.6",
"choices": [],
"usage": {
"prompt_tokens": 8314,
"completion_tokens": 1592,
"total_tokens": 9906,
"prompt_tokens_details": {"cached_tokens": 6144, "audio_tokens": 330},
"completion_tokens_details": {"reasoning_tokens": 900, "audio_tokens": 280},
},
},
done=True,
),
),
expected=ExactExpected(
spend=0.06169072, input_cost=0.01794792, output_cost=0.0437428, prompt_tokens=8314, completion_tokens=1592
),
)
# azure/whisper-next
AZURE_WHISPER_NEXT_TRANSCRIPTIONS_DEPLOYMENT: Final = CostTrackingTestCase(
name="azure-whisper-next-transcriptions-deployment",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/whisper-next",
endpoint="/v1/audio/transcriptions",
deployment=Deployment(model="azure/cc-whisper-deployment", base_model="azure/whisper-next"),
upload=WavUpload(kind="wav", seconds=3.5),
request={"response_format": "json"},
response=JsonResponse(content_type="application/json", body={"text": "hello"}),
expected=ExactExpected(spend=0.000385, input_cost=0.000385, output_cost=0, prompt_tokens=0, completion_tokens=0),
)
# azure/tts-next
AZURE_TTS_NEXT_SPEECH_DEPLOYMENT: Final = CostTrackingTestCase(
name="azure-tts-next-speech-deployment",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/tts-next",
endpoint="/v1/audio/speech",
deployment=Deployment(model="azure/cc-tts-deployment", base_model="azure/tts-next"),
request={"input": "hello world", "voice": "alloy", "response_format": "mp3"},
response=BinaryResponse(content_type="audio/mpeg", length=2048),
expected=ExactExpected(spend=0.00011, input_cost=0.00011, output_cost=0, prompt_tokens=0, completion_tokens=0),
)
# azure/text-embedding-4-large
AZURE_TEXT_EMBEDDINGS_4_LARGE_DEPLOYMENT: Final = CostTrackingTestCase(
name="azure-text-embeddings-4-large-deployment",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/text-embedding-4-large",
endpoint="/v1/embeddings",
deployment=Deployment(model="azure/cc-pinned-embedding-deployment", base_model="azure/text-embedding-4-large"),
request={"model": "$MODEL", "input": "azure embedding"},
response=JsonResponse(
content_type="application/json",
body={
"object": "list",
"data": [{"object": "embedding", "embedding": [0.1, 0.2, 0.3], "index": 0}],
"model": "azure/text-embedding-4-large",
"usage": {"prompt_tokens": 8, "total_tokens": 8},
},
),
expected=ExactExpected(spend=8.24e-06, input_cost=8.24e-06, output_cost=0.0, prompt_tokens=8, completion_tokens=0),
)
_GPT_6_CONTENT_FILTER_RESULTS: Final = {
"hate": {"filtered": False, "severity": "safe"},
"protected_material_code": {"detected": False, "filtered": False},
"protected_material_text": {"detected": False, "filtered": False},
"self_harm": {"filtered": False, "severity": "safe"},
"sexual": {"filtered": False, "severity": "safe"},
"violence": {"filtered": False, "severity": "safe"},
}
_GPT_6_PROMPT_FILTER_RESULTS: Final = [
{
"prompt_index": 0,
"content_filter_results": {
"hate": {"filtered": False, "severity": "safe"},
"jailbreak": {"detected": False, "filtered": False},
"self_harm": {"filtered": False, "severity": "safe"},
"sexual": {"filtered": False, "severity": "safe"},
"violence": {"filtered": False, "severity": "safe"},
},
}
]
AZURE_GPT_6_SOL_INPUT_TEXT: Final = CostTrackingTestCase(
name="azure-gpt-6-sol-input_text",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "f77f71b0428a summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer f77f71b0428a",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791852029,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260922011332-060efdec-prefill-r0-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.00897, input_cost=0.004232, output_cost=0.004738, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_SOL_STREAM: Final = CostTrackingTestCase(
name="azure-gpt-6-sol-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "bf171da6c983 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer bf171da6c983"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r11-dp0-prefill"},
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
),
expected=ExactExpected(
spend=0.00897, input_cost=0.004232, output_cost=0.004738, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_SOL_SERVICE_TIER_FLEX: Final = CostTrackingTestCase(
name="azure-gpt-6-sol-service_tier_flex",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "54651d96d231 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"service_tier": "flex",
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 54651d96d231",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791852029,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260922011332-060efdec-prefill-r0-dp0-prefill"},
"service_tier": "flex",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.004485, input_cost=0.002116, output_cost=0.002369, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_SOL_SERVICE_TIER_PRIORITY: Final = CostTrackingTestCase(
name="azure-gpt-6-sol-service_tier_priority",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "6add01b22373 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"service_tier": "priority",
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 6add01b22373",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791852029,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260922011332-060efdec-prefill-r0-dp0-prefill"},
"service_tier": "priority",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.01794, input_cost=0.008464, output_cost=0.009476, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_LUNA_INPUT_TEXT: Final = CostTrackingTestCase(
name="azure-gpt-6-luna-input_text",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-luna",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "a6a8b0e9d64c summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer a6a8b0e9d64c",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791852029,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260922011332-060efdec-prefill-r0-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.000507, input_cost=0.0002392, output_cost=0.0002678, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_LUNA_STREAM: Final = CostTrackingTestCase(
name="azure-gpt-6-luna-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6-luna",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "b22d4ad4da33 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer b22d4ad4da33"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r11-dp0-prefill"},
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
),
expected=ExactExpected(
spend=0.000507, input_cost=0.0002392, output_cost=0.0002678, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_ASTRA_INPUT_TEXT: Final = CostTrackingTestCase(
name="azure-gpt-6-astra-input_text",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-astra",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "41ccdf63f9d7 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 41ccdf63f9d7",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791852029,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260922011332-060efdec-prefill-r0-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.04875, input_cost=0.023, output_cost=0.02575, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_ASTRA_STREAM: Final = CostTrackingTestCase(
name="azure-gpt-6-astra-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6-astra",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "480ff10f91fb summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer 480ff10f91fb"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r11-dp0-prefill"},
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
),
expected=ExactExpected(
spend=0.04875, input_cost=0.023, output_cost=0.02575, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_1_SOL_INPUT_TEXT: Final = CostTrackingTestCase(
name="azure-gpt-6.1-sol-input_text",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6.1-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "89ad6904966e summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 89ad6904966e",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791852029,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260922011332-060efdec-prefill-r0-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.00936, input_cost=0.004416, output_cost=0.004944, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_1_SOL_STREAM: Final = CostTrackingTestCase(
name="azure-gpt-6.1-sol-stream",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6.1-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "493cd994b1de summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"stream_options": {"include_usage": True},
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer 493cd994b1de"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"usage": None,
},
{
"choices": [],
"created": 1791852023,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r11-dp0-prefill"},
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 4,
"engine_ttft_ms": 131,
"engine_ttlt_ms": 157,
"pre_inference_ms": 55,
"service_tbt_ms": 5,
"service_ttft_ms": 1034,
"service_ttlt_ms": 1058,
"user_visible_ttft_ms": 979,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
),
expected=ExactExpected(
spend=0.00936, input_cost=0.004416, output_cost=0.004944, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_SOL_REASONING: Final = CostTrackingTestCase(
name="azure/gpt-6-sol-reasoning",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "5c0e79234ed5 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"reasoning_effort": "medium",
"allowed_openai_params": ["reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 5c0e79234ed5",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791855585,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 4040,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 3480,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1240,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 5280,
},
},
),
expected=ExactExpected(
spend=0.049312, input_cost=0.002852, output_cost=0.04646, prompt_tokens=1240, completion_tokens=4040
),
)
AZURE_GPT_6_SOL_STREAM_NO_USAGE: Final = CostTrackingTestCase(
name="azure/gpt-6-sol-stream_no_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "29fbe99c40db summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "5A3jk",
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer 29fbe99c40db"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Q2x",
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Uz14j7Ajk4CYaTB",
},
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=2.3e-06, output_cost_per_token=1.15e-05)),
)
AZURE_GPT_6_LUNA_REASONING: Final = CostTrackingTestCase(
name="azure/gpt-6-luna-reasoning",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-luna",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "21c501e3e521 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"reasoning_effort": "medium",
"allowed_openai_params": ["reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 21c501e3e521",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791855585,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 4040,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 3480,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1240,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 5280,
},
},
),
expected=ExactExpected(
spend=0.0027872, input_cost=0.0001612, output_cost=0.002626, prompt_tokens=1240, completion_tokens=4040
),
)
AZURE_GPT_6_LUNA_STREAM_NO_USAGE: Final = CostTrackingTestCase(
name="azure/gpt-6-luna-stream_no_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6-luna",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "fef24d05a468 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "5A3jk",
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer fef24d05a468"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Q2x",
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Uz14j7Ajk4CYaTB",
},
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=1.3e-07, output_cost_per_token=6.5e-07)),
)
AZURE_GPT_6_ASTRA_REASONING: Final = CostTrackingTestCase(
name="azure/gpt-6-astra-reasoning",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-astra",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "d7f4aaa662f3 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"reasoning_effort": "medium",
"allowed_openai_params": ["reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer d7f4aaa662f3",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791855585,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 4040,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 3480,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1240,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 5280,
},
},
),
expected=ExactExpected(
spend=0.268, input_cost=0.0155, output_cost=0.2525, prompt_tokens=1240, completion_tokens=4040
),
)
AZURE_GPT_6_ASTRA_STREAM_NO_USAGE: Final = CostTrackingTestCase(
name="azure/gpt-6-astra-stream_no_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6-astra",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "65e182029270 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "5A3jk",
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer 65e182029270"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Q2x",
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Uz14j7Ajk4CYaTB",
},
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=1.25e-05, output_cost_per_token=6.25e-05)),
)
AZURE_GPT_6_1_SOL_REASONING: Final = CostTrackingTestCase(
name="azure/gpt-6.1-sol-reasoning",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6.1-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "8ac8b47d17d4 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"reasoning_effort": "medium",
"allowed_openai_params": ["reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 8ac8b47d17d4",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791855585,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 4040,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 3480,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1240,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 5280,
},
},
),
expected=ExactExpected(
spend=0.051456, input_cost=0.002976, output_cost=0.04848, prompt_tokens=1240, completion_tokens=4040
),
)
AZURE_GPT_6_1_SOL_STREAM_NO_USAGE: Final = CostTrackingTestCase(
name="azure/gpt-6.1-sol-stream_no_usage",
covers="quota_management.spend_tracking.scripted_wire.logs_cost",
model="azure/gpt-6.1-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "20e483d62a14 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": True,
"allowed_openai_params": [],
},
response=SseResponse(
content_type="text/event-stream",
frames=sse_frames(
{
"choices": [],
"created": 0,
"id": "",
"model": "",
"object": "",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
},
{
"choices": [
{
"content_filter_results": {},
"delta": {"content": "", "refusal": None, "role": "assistant"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "5A3jk",
},
{
"choices": [
{
"content_filter_results": {"protected_material_text": {"detected": False, "filtered": False}},
"delta": {"content": "scripted answer 20e483d62a14"},
"finish_reason": None,
"index": 0,
"logprobs": None,
}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Q2x",
},
{
"choices": [
{"content_filter_results": {}, "delta": {}, "finish_reason": "stop", "index": 0, "logprobs": None}
],
"created": 1791855587,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": None,
"obfuscation": "Uz14j7Ajk4CYaTB",
},
),
),
expected=RecountExpected(recount=RecountRates(input_cost_per_token=2.4e-06, output_cost_per_token=1.2e-05)),
)
AZURE_GPT_6_SOL_UPSTREAM_404_ZERO_SPEND: Final = CostTrackingTestCase(
name="azure/gpt-6-sol-upstream_404_zero_spend",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [{"role": "user", "content": "scripted upstream failure 404"}],
"stream": False,
},
response=JsonResponse(
content_type="application/json",
body={
"error": {
"type": "invalid_request_error",
"code": "DeploymentNotFound",
"message": "The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.",
}
},
status=404,
),
expected=FailureExpected(failure=FailureDetails(status=404)),
)
AZURE_GPT_6_SOL_INPUT_TEXT_ROLLUPS: Final = CostTrackingTestCase(
name="azure/gpt-6-sol-input_text_rollups",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "c01175bb4811 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer c01175bb4811",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1791855585,
"id": "chatcmpl-$UNIQUE_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.00897,
input_cost=0.004232,
output_cost=0.004738,
prompt_tokens=1840,
completion_tokens=412,
rollups=True,
),
)
AZURE_GPT_6_SOL_TOOL_CALL: Final = CostTrackingTestCase(
name="azure/gpt-6-sol-tool_call",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-sol",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "59601dc5d1c2 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"reasoning_effort": "none",
"allowed_openai_params": ["tool_choice", "reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "tool_calls",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": None,
"refusal": None,
"role": "assistant",
"tool_calls": [
{
"function": {
"arguments": '{"city":"Berlin","days":7,"units":"metric"}',
"name": "get_weather",
},
"id": "call_$REQUEST_ID",
"type": "function",
}
],
},
}
],
"created": 1791855585,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-sol-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.00897, input_cost=0.004232, output_cost=0.004738, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_LUNA_TOOL_CALL: Final = CostTrackingTestCase(
name="azure/gpt-6-luna-tool_call",
covers="quota_management.spend_tracking.cost_matrix.logs_cost",
model="azure/gpt-6-luna",
request={
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "2dc3f74a8aa3 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather and a short forecast for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"},
"days": {"type": "integer", "description": "Forecast horizon in days"},
"units": {"type": "string", "enum": ["metric", "imperial"]},
},
"required": ["city"],
},
},
}
],
"tool_choice": "auto",
"reasoning_effort": "none",
"allowed_openai_params": ["tool_choice", "reasoning_effort"],
},
response=JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "tool_calls",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": None,
"refusal": None,
"role": "assistant",
"tool_calls": [
{
"function": {
"arguments": '{"city":"Berlin","days":7,"units":"metric"}',
"name": "get_weather",
},
"id": "call_$REQUEST_ID",
"type": "function",
}
],
},
}
],
"created": 1791855585,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260925225746-6787865d-prefill-r15-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 412,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 6,
"engine_ttft_ms": 152,
"engine_ttlt_ms": 305,
"pre_inference_ms": 102,
"service_tbt_ms": 9,
"service_ttft_ms": 389,
"service_ttlt_ms": 608,
"user_visible_ttft_ms": 288,
},
"prompt_tokens": 1840,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
"total_tokens": 2252,
},
},
),
expected=ExactExpected(
spend=0.000507, input_cost=0.0002392, output_cost=0.0002678, prompt_tokens=1840, completion_tokens=412
),
)
AZURE_GPT_6_1_SOL_CACHE_READ: Final = AZURE_GPT_5_6_CACHE_READ.model_copy(
update={
"name": "azure/gpt-6.1-sol-cache_read",
"model": "azure/gpt-6.1-sol",
"request": {
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "c3a6bc6e3512 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
"response": JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer c3a6bc6e3512",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1792042948,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6.1-sol-2026-09-29",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260929042311-28ecf0ee-prefill-r1-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 380,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 23,
"engine_ttft_ms": 484,
"engine_ttlt_ms": 999,
"pre_inference_ms": 151,
"service_tbt_ms": 25,
"service_ttft_ms": 1085,
"service_ttlt_ms": 1610,
"user_visible_ttft_ms": 934,
},
"prompt_tokens": 12928,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 12288},
"total_tokens": 13308,
},
},
),
"expected": ExactExpected(
spend=0.00904512,
input_cost=0.00448512,
output_cost=0.00456,
prompt_tokens=12928,
completion_tokens=380,
),
}
)
AZURE_GPT_6_LUNA_CACHE_READ: Final = AZURE_GPT_5_6_CACHE_READ.model_copy(
update={
"name": "azure/gpt-6-luna-cache_read",
"model": "azure/gpt-6-luna",
"request": {
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "67d7b9931ce9 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
"response": JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 67d7b9931ce9",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1792042952,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-luna-2026-09-22",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260919024711-372ad1ad-prefill-r2-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 380,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 7,
"engine_ttft_ms": 110,
"engine_ttlt_ms": 706,
"pre_inference_ms": 254,
"service_tbt_ms": 7,
"service_ttft_ms": 647,
"service_ttlt_ms": 1238,
"user_visible_ttft_ms": 393,
},
"prompt_tokens": 12928,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 12288},
"total_tokens": 13308,
},
},
),
"expected": ExactExpected(
spend=0.000489944,
input_cost=0.000242944,
output_cost=0.000247,
prompt_tokens=12928,
completion_tokens=380,
),
}
)
AZURE_GPT_6_ASTRA_CACHE_READ: Final = AZURE_GPT_5_6_CACHE_READ.model_copy(
update={
"name": "azure/gpt-6-astra-cache_read",
"model": "azure/gpt-6-astra",
"request": {
"model": "$MODEL",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are a deterministic pricing-harness assistant. Keep answers to a single short line.",
}
],
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "84f5db610aa3 summarize the attached material in one line and name the city weather",
}
],
},
],
"stream": False,
"allowed_openai_params": [],
},
"response": JsonResponse(
content_type="application/json",
body={
"choices": [
{
"content_filter_results": _GPT_6_CONTENT_FILTER_RESULTS,
"finish_reason": "stop",
"index": 0,
"logprobs": None,
"message": {
"annotations": [],
"content": "scripted answer 84f5db610aa3",
"refusal": None,
"role": "assistant",
},
}
],
"created": 1792042958,
"id": "chatcmpl-$REQUEST_ID",
"model": "gpt-6-astra-2026-09-03",
"object": "chat.completion",
"prompt_filter_results": _GPT_6_PROMPT_FILTER_RESULTS,
"routing": {"serving_pipereplica": "d20260930073654-95d85d6a-prefill-r29-dp0-prefill"},
"service_tier": "default",
"system_fingerprint": None,
"usage": {
"completion_tokens": 380,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 25,
"engine_ttft_ms": 697,
"engine_ttlt_ms": 1373,
"pre_inference_ms": 142,
"service_tbt_ms": 26,
"service_ttft_ms": 1289,
"service_ttlt_ms": 1956,
"user_visible_ttft_ms": 1147,
},
"prompt_tokens": 12928,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 12288},
"total_tokens": 13308,
},
},
),
"expected": ExactExpected(
spend=0.04711,
input_cost=0.02336,
output_cost=0.02375,
prompt_tokens=12928,
completion_tokens=380,
),
}
)
AZURE_GPT_6_SOL_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_SOL_INPUT_TEXT.model_copy(
update={
"name": "azure-gpt-6-sol-messages_bridged_json",
"endpoint": "/v1/messages",
"request": {
"model": "$MODEL",
"max_tokens": 412,
"messages": [{"role": "user", "content": "azure chat native fixture"}],
},
}
)
AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_LUNA_INPUT_TEXT.model_copy(
update={
"name": "azure-gpt-6-luna-messages_bridged_json",
"endpoint": "/v1/messages",
"request": {
"model": "$MODEL",
"max_tokens": 412,
"messages": [{"role": "user", "content": "azure chat native fixture"}],
},
}
)
AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_ASTRA_INPUT_TEXT.model_copy(
update={
"name": "azure-gpt-6-astra-messages_bridged_json",
"endpoint": "/v1/messages",
"request": {
"model": "$MODEL",
"max_tokens": 412,
"messages": [{"role": "user", "content": "azure chat native fixture"}],
},
}
)
AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_1_SOL_INPUT_TEXT.model_copy(
update={
"name": "azure-gpt-6.1-sol-messages_bridged_json",
"endpoint": "/v1/messages",
"request": {
"model": "$MODEL",
"max_tokens": 412,
"messages": [{"role": "user", "content": "azure chat native fixture"}],
},
}
)
AZURE_GPT_6_SOL_TIERED_INPUT_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_SOL_INPUT_TEXT,
"azure-gpt-6-sol-tiered_input_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=1.389476, input_cost=1.38, output_cost=0.009476, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_SOL_TIERED_CACHE_READ_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_SOL_INPUT_TEXT,
"azure-gpt-6-sol-tiered_cache_read_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 200000},
},
ExactExpected(spend=0.561476, input_cost=0.552, output_cost=0.009476, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_SOL_TIERED_AT_272K_BOUNDARY: Final = with_usage(
AZURE_GPT_6_SOL_INPUT_TEXT,
"azure-gpt-6-sol-tiered_at_272k_boundary",
{
"prompt_tokens": 272000,
"total_tokens": 272412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=0.630338, input_cost=0.6256, output_cost=0.004738, prompt_tokens=272000, completion_tokens=412),
)
AZURE_GPT_6_SOL_TIERED_FLEX_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_SOL_SERVICE_TIER_FLEX,
"azure-gpt-6-sol-tiered_flex_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=0.694738, input_cost=0.69, output_cost=0.004738, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_SOL_TIERED_PRIORITY_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_SOL_SERVICE_TIER_PRIORITY,
"azure-gpt-6-sol-tiered_priority_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=2.778952, input_cost=2.76, output_cost=0.018952, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_LUNA_TIERED_INPUT_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_LUNA_INPUT_TEXT,
"azure-gpt-6-luna-tiered_input_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(
spend=0.0785356, input_cost=0.078, output_cost=0.0005356, prompt_tokens=300000, completion_tokens=412
),
)
AZURE_GPT_6_LUNA_TIERED_CACHE_READ_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_LUNA_INPUT_TEXT,
"azure-gpt-6-luna-tiered_cache_read_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 200000},
},
ExactExpected(
spend=0.0317356, input_cost=0.0312, output_cost=0.0005356, prompt_tokens=300000, completion_tokens=412
),
)
AZURE_GPT_6_LUNA_TIERED_AT_272K_BOUNDARY: Final = with_usage(
AZURE_GPT_6_LUNA_INPUT_TEXT,
"azure-gpt-6-luna-tiered_at_272k_boundary",
{
"prompt_tokens": 272000,
"total_tokens": 272412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(
spend=0.0356278, input_cost=0.03536, output_cost=0.0002678, prompt_tokens=272000, completion_tokens=412
),
)
AZURE_GPT_6_ASTRA_TIERED_INPUT_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_ASTRA_INPUT_TEXT,
"azure-gpt-6-astra-tiered_input_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=7.5515, input_cost=7.5, output_cost=0.0515, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_ASTRA_TIERED_CACHE_READ_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_ASTRA_INPUT_TEXT,
"azure-gpt-6-astra-tiered_cache_read_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 200000},
},
ExactExpected(spend=3.0515, input_cost=3.0, output_cost=0.0515, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_ASTRA_TIERED_AT_272K_BOUNDARY: Final = with_usage(
AZURE_GPT_6_ASTRA_INPUT_TEXT,
"azure-gpt-6-astra-tiered_at_272k_boundary",
{
"prompt_tokens": 272000,
"total_tokens": 272412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=3.42575, input_cost=3.4, output_cost=0.02575, prompt_tokens=272000, completion_tokens=412),
)
AZURE_GPT_6_1_SOL_TIERED_INPUT_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_1_SOL_INPUT_TEXT,
"azure-gpt-6.1-sol-tiered_input_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=1.449888, input_cost=1.44, output_cost=0.009888, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_1_SOL_TIERED_CACHE_READ_ABOVE_272K: Final = with_usage(
AZURE_GPT_6_1_SOL_INPUT_TEXT,
"azure-gpt-6.1-sol-tiered_cache_read_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 200000},
},
ExactExpected(spend=0.585888, input_cost=0.576, output_cost=0.009888, prompt_tokens=300000, completion_tokens=412),
)
AZURE_GPT_6_1_SOL_TIERED_AT_272K_BOUNDARY: Final = with_usage(
AZURE_GPT_6_1_SOL_INPUT_TEXT,
"azure-gpt-6.1-sol-tiered_at_272k_boundary",
{
"prompt_tokens": 272000,
"total_tokens": 272412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(spend=0.657744, input_cost=0.6528, output_cost=0.004944, prompt_tokens=272000, completion_tokens=412),
)
AZURE_GPT_6_1_SOL_CACHE_WRITE_5M: Final = with_response_usage(
AZURE_GPT_6_1_SOL_CACHE_READ,
"azure/gpt-6.1-sol-cache_write_5m",
{
"completion_tokens": 380,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 15,
"engine_ttft_ms": 1118,
"engine_ttlt_ms": 1221,
"pre_inference_ms": 172,
"service_tbt_ms": 15,
"service_ttft_ms": 1562,
"service_ttlt_ms": 1652,
"user_visible_ttft_ms": 1390,
},
"prompt_tokens": 12928,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 12288, "cached_tokens": 0},
"total_tokens": 13308,
},
ExactExpected(spend=0.04296, input_cost=0.0384, output_cost=0.00456, prompt_tokens=12928, completion_tokens=380),
)
AZURE_GPT_6_LUNA_CACHE_WRITE_5M: Final = with_response_usage(
AZURE_GPT_6_LUNA_CACHE_READ,
"azure/gpt-6-luna-cache_write_5m",
{
"completion_tokens": 380,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 7,
"engine_ttft_ms": 143,
"engine_ttlt_ms": 309,
"pre_inference_ms": 132,
"service_tbt_ms": 8,
"service_ttft_ms": 566,
"service_ttlt_ms": 748,
"user_visible_ttft_ms": 434,
},
"prompt_tokens": 12928,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 12288, "cached_tokens": 0},
"total_tokens": 13308,
},
ExactExpected(spend=0.002327, input_cost=0.00208, output_cost=0.000247, prompt_tokens=12928, completion_tokens=380),
choice_updates={
"content_filter_result": {"error": {"code": "content_filter_error", "message": "The contents are not filtered"}}
},
)
AZURE_GPT_5_6_TERRA_INPUT_TEXT: Final = AZURE_GPT_6_LUNA_INPUT_TEXT.model_copy(
update={
"name": "azure-gpt-5.6-terra-input_text",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_6_LUNA_INPUT_TEXT.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.0094864,
input_cost=0.004048,
output_cost=0.0054384,
prompt_tokens=1840,
completion_tokens=412,
),
}
)
AZURE_GPT_5_6_TERRA_STREAM: Final = AZURE_GPT_6_LUNA_STREAM.model_copy(
update={
"name": "azure-gpt-5.6-terra-stream",
"model": "azure/gpt-5.6-terra",
"response": _stream_for_model(
cast(SseResponse, AZURE_GPT_6_LUNA_STREAM.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.0094864,
input_cost=0.004048,
output_cost=0.0054384,
prompt_tokens=1840,
completion_tokens=412,
),
}
)
AZURE_GPT_5_6_TERRA_SERVICE_TIER_FLEX: Final = AZURE_GPT_5_6_SERVICE_TIER_FLEX.model_copy(
update={
"name": "azure-gpt-5.6-terra-service_tier_flex",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_5_6_SERVICE_TIER_FLEX.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.0047432,
input_cost=0.002024,
output_cost=0.0027192,
prompt_tokens=1840,
completion_tokens=412,
),
}
)
AZURE_GPT_5_6_TERRA_SERVICE_TIER_PRIORITY: Final = AZURE_GPT_5_6_SERVICE_TIER_PRIORITY.model_copy(
update={
"name": "azure-gpt-5.6-terra-service_tier_priority",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_5_6_SERVICE_TIER_PRIORITY.response),
"gpt-5.6-terra-2026-07-09",
service_tier="default",
),
"expected": ExactExpected(
spend=0.0189728,
input_cost=0.008096,
output_cost=0.0108768,
prompt_tokens=1840,
completion_tokens=412,
),
"known_bug": "Azure GPT Terra priority service tier is billed at the base rate",
}
)
AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_JSON: Final = AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON.model_copy(
update={
"name": "azure-gpt-5.6-terra-messages_bridged_json",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.0094864,
input_cost=0.004048,
output_cost=0.0054384,
prompt_tokens=1840,
completion_tokens=412,
),
}
)
AZURE_GPT_5_6_TERRA_CACHE_READ: Final = AZURE_GPT_6_LUNA_CACHE_READ.model_copy(
update={
"name": "azure/gpt-5.6-terra-cache_read",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_6_LUNA_CACHE_READ.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.00912736,
input_cost=0.00411136,
output_cost=0.005016,
prompt_tokens=12928,
completion_tokens=380,
),
}
)
AZURE_GPT_5_6_TERRA_CACHE_WRITE_5M: Final = AZURE_GPT_6_LUNA_CACHE_WRITE_5M.model_copy(
update={
"name": "azure/gpt-5.6-terra-cache_write_5m",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_6_LUNA_CACHE_WRITE_5M.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.040216,
input_cost=0.0352,
output_cost=0.005016,
prompt_tokens=12928,
completion_tokens=380,
),
}
)
AZURE_GPT_5_6_TERRA_REASONING: Final = AZURE_GPT_6_LUNA_REASONING.model_copy(
update={
"name": "azure/gpt-5.6-terra-reasoning",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_6_LUNA_REASONING.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.056056,
input_cost=0.002728,
output_cost=0.053328,
prompt_tokens=1240,
completion_tokens=4040,
),
}
)
AZURE_GPT_5_6_TERRA_TOOL_CALL: Final = AZURE_GPT_6_LUNA_TOOL_CALL.model_copy(
update={
"name": "azure/gpt-5.6-terra-tool_call",
"model": "azure/gpt-5.6-terra",
"response": _response_for_model(
cast(JsonResponse, AZURE_GPT_6_LUNA_TOOL_CALL.response), "gpt-5.6-terra-2026-07-09"
),
"expected": ExactExpected(
spend=0.0094864,
input_cost=0.004048,
output_cost=0.0054384,
prompt_tokens=1840,
completion_tokens=412,
),
}
)
AZURE_GPT_6_ASTRA_CACHE_WRITE_5M: Final = with_response_usage(
AZURE_GPT_6_ASTRA_CACHE_READ,
"azure/gpt-6-astra-cache_write_5m",
{
"completion_tokens": 380,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
},
"latency_checkpoint": {
"engine_tbt_ms": 36,
"engine_ttft_ms": 537,
"engine_ttlt_ms": 751,
"pre_inference_ms": 356,
"service_tbt_ms": 41,
"service_ttft_ms": 1166,
"service_ttlt_ms": 1371,
"user_visible_ttft_ms": 810,
},
"prompt_tokens": 12928,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 12288, "cached_tokens": 0},
"total_tokens": 13308,
},
ExactExpected(spend=0.22375, input_cost=0.2, output_cost=0.02375, prompt_tokens=12928, completion_tokens=380),
)
AZURE_GPT_5_6_TERRA_TIERED_INPUT_ABOVE_272K: Final = with_usage(
AZURE_GPT_5_6_TERRA_INPUT_TEXT,
"azure/gpt-5.6-terra-tiered_input_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 0},
},
ExactExpected(
spend=1.3281576, input_cost=1.32, output_cost=0.0081576, prompt_tokens=300000, completion_tokens=412
),
)
AZURE_GPT_5_6_TERRA_TIERED_CACHE_READ_ABOVE_272K: Final = with_usage(
AZURE_GPT_5_6_TERRA_INPUT_TEXT,
"azure/gpt-5.6-terra-tiered_cache_read_above_272k",
{
"prompt_tokens": 300000,
"total_tokens": 300412,
"prompt_tokens_details": {"audio_tokens": 0, "cache_write_tokens": 0, "cached_tokens": 200000},
},
ExactExpected(
spend=0.5361576, input_cost=0.528, output_cost=0.0081576, prompt_tokens=300000, completion_tokens=412
),
)
AZURE_GPT_6_1_SOL_RESPONSES_JSON: Final = _azure_responses_json_case(
AZURE_GPT_6_1_SOL_INPUT_TEXT, "azure-gpt-6.1-sol-responses_json", "gpt-6.1-sol", None
)
AZURE_GPT_6_LUNA_RESPONSES_JSON: Final = _azure_responses_json_case(
AZURE_GPT_6_LUNA_INPUT_TEXT, "azure-gpt-6-luna-responses_json", "gpt-6-luna", None
)
AZURE_GPT_6_ASTRA_RESPONSES_JSON: Final = _azure_responses_json_case(
AZURE_GPT_6_ASTRA_INPUT_TEXT, "azure-gpt-6-astra-responses_json", "gpt-6-astra", []
)
AZURE_GPT_5_6_TERRA_RESPONSES_JSON: Final = _azure_responses_json_case(
AZURE_GPT_5_6_TERRA_INPUT_TEXT, "azure-gpt-5.6-terra-responses_json", "gpt-5.6-terra", None
)
AZURE_GPT_6_1_SOL_RESPONSES_STREAM: Final = _responses_stream_case(
AZURE_GPT_6_1_SOL_RESPONSES_JSON,
"azure-gpt-6.1-sol-responses_stream",
"gpt-6.1-sol",
14,
include_content_filters=True,
)
AZURE_GPT_6_LUNA_RESPONSES_STREAM: Final = _responses_stream_case(
AZURE_GPT_6_LUNA_RESPONSES_JSON,
"azure-gpt-6-luna-responses_stream",
"gpt-6-luna",
25,
include_content_filters=True,
)
AZURE_GPT_6_ASTRA_RESPONSES_STREAM: Final = _responses_stream_case(
AZURE_GPT_6_ASTRA_RESPONSES_JSON,
"azure-gpt-6-astra-responses_stream",
"gpt-6-astra",
16,
include_content_filters=True,
content_filters=[],
)
AZURE_GPT_5_6_TERRA_RESPONSES_STREAM: Final = _responses_stream_case(
AZURE_GPT_5_6_TERRA_RESPONSES_JSON,
"azure-gpt-5.6-terra-responses_stream",
"gpt-5.6-terra",
15,
include_content_filters=True,
)
AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_STREAM: Final = _azure_messages_stream_case(
AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON, AZURE_GPT_6_1_SOL_STREAM, "azure-gpt-6.1-sol-messages_bridged_stream"
)
AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_STREAM: Final = _azure_messages_stream_case(
AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON, AZURE_GPT_6_LUNA_STREAM, "azure-gpt-6-luna-messages_bridged_stream"
)
AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_STREAM: Final = _azure_messages_stream_case(
AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON, AZURE_GPT_6_ASTRA_STREAM, "azure-gpt-6-astra-messages_bridged_stream"
)
AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_STREAM: Final = _azure_messages_stream_case(
AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_JSON, AZURE_GPT_5_6_TERRA_STREAM, "azure-gpt-5.6-terra-messages_bridged_stream"
)
CASES: Final[tuple[CostTrackingTestCase, ...]] = (
AZURE_GPT_6_SOL_MESSAGES_BRIDGED_JSON,
AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON,
AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON,
AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON,
AZURE_GPT_6_SOL_TIERED_INPUT_ABOVE_272K,
AZURE_GPT_6_SOL_TIERED_CACHE_READ_ABOVE_272K,
AZURE_GPT_6_SOL_TIERED_AT_272K_BOUNDARY,
AZURE_GPT_6_SOL_TIERED_FLEX_ABOVE_272K,
AZURE_GPT_6_SOL_TIERED_PRIORITY_ABOVE_272K,
AZURE_GPT_6_LUNA_TIERED_INPUT_ABOVE_272K,
AZURE_GPT_6_LUNA_TIERED_CACHE_READ_ABOVE_272K,
AZURE_GPT_6_LUNA_TIERED_AT_272K_BOUNDARY,
AZURE_GPT_6_ASTRA_TIERED_INPUT_ABOVE_272K,
AZURE_GPT_6_ASTRA_TIERED_CACHE_READ_ABOVE_272K,
AZURE_GPT_6_ASTRA_TIERED_AT_272K_BOUNDARY,
AZURE_GPT_6_1_SOL_TIERED_INPUT_ABOVE_272K,
AZURE_GPT_6_1_SOL_TIERED_CACHE_READ_ABOVE_272K,
AZURE_GPT_6_1_SOL_TIERED_AT_272K_BOUNDARY,
AZURE_GPT_5_4_MINI_INPUT_TEXT,
AZURE_GPT_5_4_MINI_CACHE_READ,
AZURE_GPT_5_4_MINI_AUDIO_INPUT,
AZURE_GPT_5_4_MINI_AUDIO_OUTPUT,
AZURE_GPT_5_4_MINI_REASONING,
AZURE_GPT_5_4_MINI_SERVICE_TIER_FLEX,
AZURE_GPT_5_4_MINI_SERVICE_TIER_PRIORITY,
AZURE_GPT_5_4_MINI_WEB_SEARCH_MEDIUM,
AZURE_GPT_5_4_MINI_WEB_SEARCH_LOW,
AZURE_GPT_5_4_MINI_WEB_SEARCH_HIGH,
AZURE_GPT_5_4_MINI_STREAM,
AZURE_GPT_5_4_MINI_STREAM_NO_USAGE,
AZURE_GPT_5_4_MINI_STREAM_NO_USAGE_TOOL_CALL,
AZURE_GPT_5_4_MINI_STREAM_NO_USAGE_IMAGE_INPUT,
AZURE_GPT_5_4_MINI_RESPONSE_MODEL_OVERRIDE,
AZURE_GPT_5_4_MINI_STREAM_RESPONSE_MODEL_OVERRIDE,
AZURE_GPT_5_4_MINI_TOOL_CALL,
AZURE_GPT_5_4_MINI_STREAM_TOOL_CALL,
AZURE_GPT_5_4_MINI_STREAM_FULL_USAGE,
AZURE_GPT_5_6_INPUT_TEXT,
AZURE_GPT_5_6_CACHE_READ,
AZURE_GPT_5_6_AUDIO_INPUT,
AZURE_GPT_5_6_AUDIO_OUTPUT,
AZURE_GPT_5_6_REASONING,
AZURE_GPT_5_6_SERVICE_TIER_FLEX,
AZURE_GPT_5_6_SERVICE_TIER_PRIORITY,
AZURE_GPT_5_6_WEB_SEARCH_MEDIUM,
AZURE_GPT_5_6_WEB_SEARCH_LOW,
AZURE_GPT_5_6_WEB_SEARCH_HIGH,
AZURE_GPT_5_6_STREAM,
AZURE_GPT_5_6_STREAM_NO_USAGE,
AZURE_GPT_5_6_STREAM_NO_USAGE_TOOL_CALL,
AZURE_GPT_5_6_STREAM_NO_USAGE_IMAGE_INPUT,
AZURE_GPT_5_6_RESPONSE_MODEL_OVERRIDE,
AZURE_GPT_5_6_STREAM_RESPONSE_MODEL_OVERRIDE,
AZURE_GPT_5_6_TOOL_CALL,
AZURE_GPT_5_6_STREAM_TOOL_CALL,
AZURE_GPT_5_6_STREAM_FULL_USAGE,
AZURE_WHISPER_NEXT_TRANSCRIPTIONS_DEPLOYMENT,
AZURE_TTS_NEXT_SPEECH_DEPLOYMENT,
AZURE_TEXT_EMBEDDINGS_4_LARGE_DEPLOYMENT,
AZURE_PINNED_GPT_5_4_MINI_STREAM,
AZURE_GPT_6_SOL_INPUT_TEXT,
AZURE_GPT_6_SOL_STREAM,
AZURE_GPT_6_SOL_SERVICE_TIER_FLEX,
AZURE_GPT_6_SOL_SERVICE_TIER_PRIORITY,
AZURE_GPT_6_LUNA_INPUT_TEXT,
AZURE_GPT_6_LUNA_STREAM,
AZURE_GPT_6_ASTRA_INPUT_TEXT,
AZURE_GPT_6_ASTRA_STREAM,
AZURE_GPT_6_1_SOL_INPUT_TEXT,
AZURE_GPT_6_1_SOL_STREAM,
AZURE_GPT_6_SOL_REASONING,
AZURE_GPT_6_SOL_STREAM_NO_USAGE,
AZURE_GPT_6_LUNA_REASONING,
AZURE_GPT_6_LUNA_STREAM_NO_USAGE,
AZURE_GPT_6_ASTRA_REASONING,
AZURE_GPT_6_ASTRA_STREAM_NO_USAGE,
AZURE_GPT_6_1_SOL_REASONING,
AZURE_GPT_6_1_SOL_STREAM_NO_USAGE,
AZURE_GPT_6_SOL_UPSTREAM_404_ZERO_SPEND,
AZURE_GPT_6_SOL_INPUT_TEXT_ROLLUPS,
AZURE_GPT_6_SOL_TOOL_CALL,
AZURE_GPT_6_LUNA_TOOL_CALL,
AZURE_GPT_6_1_SOL_CACHE_READ,
AZURE_GPT_6_LUNA_CACHE_READ,
AZURE_GPT_6_ASTRA_CACHE_READ,
AZURE_GPT_6_1_SOL_CACHE_WRITE_5M,
AZURE_GPT_6_LUNA_CACHE_WRITE_5M,
AZURE_GPT_6_ASTRA_CACHE_WRITE_5M,
AZURE_GPT_5_6_TERRA_INPUT_TEXT,
AZURE_GPT_5_6_TERRA_TIERED_INPUT_ABOVE_272K,
AZURE_GPT_5_6_TERRA_TIERED_CACHE_READ_ABOVE_272K,
AZURE_GPT_5_6_TERRA_STREAM,
AZURE_GPT_5_6_TERRA_SERVICE_TIER_FLEX,
AZURE_GPT_5_6_TERRA_SERVICE_TIER_PRIORITY,
AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_JSON,
AZURE_GPT_5_6_TERRA_CACHE_READ,
AZURE_GPT_5_6_TERRA_CACHE_WRITE_5M,
AZURE_GPT_5_6_TERRA_REASONING,
AZURE_GPT_5_6_TERRA_TOOL_CALL,
AZURE_GPT_6_1_SOL_RESPONSES_JSON,
AZURE_GPT_6_1_SOL_RESPONSES_STREAM,
AZURE_GPT_6_LUNA_RESPONSES_JSON,
AZURE_GPT_6_LUNA_RESPONSES_STREAM,
AZURE_GPT_6_ASTRA_RESPONSES_JSON,
AZURE_GPT_6_ASTRA_RESPONSES_STREAM,
AZURE_GPT_5_6_TERRA_RESPONSES_JSON,
AZURE_GPT_5_6_TERRA_RESPONSES_STREAM,
AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_STREAM,
AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_STREAM,
AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_STREAM,
AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_STREAM,
)
PARITY: Final[tuple[StreamParityTestCase, ...]] = (
StreamParityTestCase(plain=AZURE_GPT_5_6_INPUT_TEXT, streamed=AZURE_GPT_5_6_STREAM),
StreamParityTestCase(
plain=AZURE_GPT_5_6_RESPONSE_MODEL_OVERRIDE, streamed=AZURE_GPT_5_6_STREAM_RESPONSE_MODEL_OVERRIDE
),
StreamParityTestCase(plain=AZURE_GPT_5_6_TOOL_CALL, streamed=AZURE_GPT_5_6_STREAM_TOOL_CALL),
StreamParityTestCase(plain=AZURE_GPT_6_SOL_INPUT_TEXT, streamed=AZURE_GPT_6_SOL_STREAM),
StreamParityTestCase(plain=AZURE_GPT_6_LUNA_INPUT_TEXT, streamed=AZURE_GPT_6_LUNA_STREAM),
StreamParityTestCase(plain=AZURE_GPT_6_ASTRA_INPUT_TEXT, streamed=AZURE_GPT_6_ASTRA_STREAM),
StreamParityTestCase(plain=AZURE_GPT_6_1_SOL_INPUT_TEXT, streamed=AZURE_GPT_6_1_SOL_STREAM),
StreamParityTestCase(plain=AZURE_GPT_5_6_TERRA_INPUT_TEXT, streamed=AZURE_GPT_5_6_TERRA_STREAM),
StreamParityTestCase(plain=AZURE_GPT_6_1_SOL_RESPONSES_JSON, streamed=AZURE_GPT_6_1_SOL_RESPONSES_STREAM),
StreamParityTestCase(plain=AZURE_GPT_6_LUNA_RESPONSES_JSON, streamed=AZURE_GPT_6_LUNA_RESPONSES_STREAM),
StreamParityTestCase(plain=AZURE_GPT_6_ASTRA_RESPONSES_JSON, streamed=AZURE_GPT_6_ASTRA_RESPONSES_STREAM),
StreamParityTestCase(plain=AZURE_GPT_5_6_TERRA_RESPONSES_JSON, streamed=AZURE_GPT_5_6_TERRA_RESPONSES_STREAM),
StreamParityTestCase(
plain=AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON, streamed=AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_STREAM
),
StreamParityTestCase(
plain=AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON, streamed=AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_STREAM
),
StreamParityTestCase(
plain=AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON, streamed=AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_STREAM
),
StreamParityTestCase(
plain=AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_JSON, streamed=AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_STREAM
),
)
BRIDGE_COST_PARITY: Final[tuple[BridgeCostParityTestCase, ...]] = (
*bridge_pairs(
(AZURE_GPT_5_6_INPUT_TEXT, AZURE_GPT_5_6_CACHE_READ, AZURE_GPT_5_6_STREAM, AZURE_GPT_5_6_REASONING),
("/v1/messages",),
),
BridgeCostParityTestCase(native=AZURE_GPT_6_SOL_INPUT_TEXT, bridged=AZURE_GPT_6_SOL_MESSAGES_BRIDGED_JSON),
BridgeCostParityTestCase(native=AZURE_GPT_6_LUNA_INPUT_TEXT, bridged=AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_JSON),
BridgeCostParityTestCase(native=AZURE_GPT_6_ASTRA_INPUT_TEXT, bridged=AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_JSON),
BridgeCostParityTestCase(native=AZURE_GPT_6_1_SOL_INPUT_TEXT, bridged=AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_JSON),
BridgeCostParityTestCase(
native=AZURE_GPT_5_6_TERRA_INPUT_TEXT, bridged=AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_JSON
),
BridgeCostParityTestCase(native=AZURE_GPT_6_1_SOL_STREAM, bridged=AZURE_GPT_6_1_SOL_MESSAGES_BRIDGED_STREAM),
BridgeCostParityTestCase(native=AZURE_GPT_6_LUNA_STREAM, bridged=AZURE_GPT_6_LUNA_MESSAGES_BRIDGED_STREAM),
BridgeCostParityTestCase(native=AZURE_GPT_6_ASTRA_STREAM, bridged=AZURE_GPT_6_ASTRA_MESSAGES_BRIDGED_STREAM),
BridgeCostParityTestCase(
native=AZURE_GPT_5_6_TERRA_STREAM, bridged=AZURE_GPT_5_6_TERRA_MESSAGES_BRIDGED_STREAM
),
)