{ "model_id": "anthropic/claude-fable-5.1", "provider_id": "anthropic", "name": "Claude Fable 5.1", "description": "Claude Fable 5.1 is Anthropic's next model in the Fable family, with improvements in agentic coding, long-running agentic workflows, knowledge work, front-end and visual code generation, and finance and analysis tasks. It supports adaptive thinking and a 1M token context window.", "task": "Text Generation", "tags": [ "LLM", "Coding", "Reasoning", "Enterprise", "Agentic" ], "context_length": 1000000, "max_output_tokens": 128000, "schema_version": "1.0.0", "pricing": { "Input tokens (per 1M)": 10, "Cached input tokens (per 1M)": 0.25, "Cache creation tokens (per 1M)": 12.5, "Output tokens (per 1M)": 50 }, "examples": [ { "name": "With System Message", "description": "Set context with a system message", "input": { "max_tokens": 1024, "messages": [ { "content": "How do I read a JSON file in Python?", "role": "user" } ], "system": "You are a helpful coding assistant specializing in Python." }, "output": { "text": "Use the built-in `json` module:\n\n```python\nimport json\n\nwith open(\"data.json\", \"r\", encoding=\"utf-8\") as f:\n data = json.load(f)\n\nprint(data)\n```\n\n**What this does:**\n- `open(...)` opens the file; the `with` block closes it automatically.\n- `json.load(f)` parses the file contents into Python objects:\n - JSON object `{}` \u2192 `dict`\n - JSON array `[]` \u2192 `list`\n - strings \u2192 `str`, numbers \u2192 `int`/`float`, `true`/`false` \u2192 `True`/`False`, `null` \u2192 `None`\n\n**Example:** if `data.json` contains\n\n```json\n{\"name\": \"Alice\", \"age\": 30, \"tags\": [\"admin\", \"user\"]}\n```\n\nthen:\n\n```python\nprint(data[\"name\"]) # Alice\nprint(data[\"tags\"][0]) # admin\n```\n\n**Related tips:**\n- If you already have JSON as a string (not a file), use `json.loads(text)` instead.\n- To handle a missing or malformed file gracefully:\n\n```python\nimport json\n\ntry:\n with open(\"data.json\", encoding=\"utf-8\") as f:\n data = json.load(f)\nexcept FileNotFoundError:\n print(\"File not found\")\nexcept json.JSONDecodeError as e:\n print(f\"Invalid JSON: {e}\")\n```\n\n- To write JSON back out: `json.dump(data, f, indent=2)`." }, "raw_response": { "id": "msg_011CedBpeQJCnJHy2SvhfpSH", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Use the built-in `json` module:\n\n```python\nimport json\n\nwith open(\"data.json\", \"r\", encoding=\"utf-8\") as f:\n data = json.load(f)\n\nprint(data)\n```\n\n**What this does:**\n- `open(...)` opens the file; the `with` block closes it automatically.\n- `json.load(f)` parses the file contents into Python objects:\n - JSON object `{}` \u2192 `dict`\n - JSON array `[]` \u2192 `list`\n - strings \u2192 `str`, numbers \u2192 `int`/`float`, `true`/`false` \u2192 `True`/`False`, `null` \u2192 `None`\n\n**Example:** if `data.json` contains\n\n```json\n{\"name\": \"Alice\", \"age\": 30, \"tags\": [\"admin\", \"user\"]}\n```\n\nthen:\n\n```python\nprint(data[\"name\"]) # Alice\nprint(data[\"tags\"][0]) # admin\n```\n\n**Related tips:**\n- If you already have JSON as a string (not a file), use `json.loads(text)` instead.\n- To handle a missing or malformed file gracefully:\n\n```python\nimport json\n\ntry:\n with open(\"data.json\", encoding=\"utf-8\") as f:\n data = json.load(f)\nexcept FileNotFoundError:\n print(\"File not found\")\nexcept json.JSONDecodeError as e:\n print(f\"Invalid JSON: {e}\")\n```\n\n- To write JSON back out: `json.dump(data, f, indent=2)`." } ], "model": "claude-fable-5-1", "stop_reason": "end_turn", "usage": { "input_tokens": 40, "output_tokens": 451 }, "stop_sequence": null, "stop_details": null, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'anthropic/claude-fable-5.1',\n {\n max_tokens: 1024,\n messages: [{ content: 'How do I read a JSON file in Python?', role: 'user' }],\n system: 'You are a helpful coding assistant specializing in Python.',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/messages \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"anthropic/claude-fable-5.1\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"content\": \"How do I read a JSON file in Python?\",\n \"role\": \"user\"\n }\n ],\n \"system\": \"You are a helpful coding assistant specializing in Python.\"\n}'" } ] }, { "name": "Multi-turn Conversation", "description": "Continue a conversation with prior assistant context", "input": { "max_tokens": 1024, "messages": [ { "content": "I need help planning a road trip from San Francisco to Los Angeles.", "role": "user" }, { "content": "I'd be happy to help! The drive is about 380 miles and takes roughly 5-6 hours. Would you like suggestions for scenic routes or interesting stops along the way?", "role": "assistant" }, { "content": "Yes, what are some good places to stop?", "role": "user" } ] }, "output": { "text": "Great choice! Your stops depend on which route you take, so here are the two main options:\n\n**Highway 1 / Pacific Coast Highway (scenic, ~10-12 hours with stops, best over 2 days)**\n\n- **Half Moon Bay** \u2013 Quaint coastal town with good seafood and beaches\n- **Santa Cruz** \u2013 Beach Boardwalk, surfing culture, and redwoods nearby\n- **Monterey** \u2013 World-class aquarium, Cannery Row, and Fisherman's Wharf\n- **17-Mile Drive / Pebble Beach** \u2013 Iconic coastline with the Lone Cypress (small toll)\n- **Carmel-by-the-Sea** \u2013 Charming village with galleries and Carmel Beach\n- **Big Sur** \u2013 The highlight: Bixby Bridge, McWay Falls, Pfeiffer Beach (purple sand), and Nepenthe restaurant for lunch with a view\n- **Hearst Castle (San Simeon)** \u2013 Fascinating mansion tour; the elephant seals at Piedras Blancas nearby are a fun free stop\n- **Cambria / Morro Bay** \u2013 Morro Rock and a laid-back harbor town\n- **San Luis Obispo** \u2013 Great downtown, Bubblegum Alley, and the quirky Madonna Inn\n- **Pismo Beach** \u2013 Classic beach town, good for a break\n- **Solvang** \u2013 A Danish-themed village with pastries and wine tasting\n- **Santa Barbara** \u2013 Beautiful Spanish architecture, State Street, and the waterfront\n- **Malibu** \u2013 Beaches and a final scenic stretch into LA\n\n**US-101 (faster, ~6-7 hours)**\n\n- **Gilroy** \u2013 Garlic capital, outlet shopping\n- **Paso Robles** \u2013 Excellent wine country, less crowded than Napa\n- **San Luis Obispo, Solvang, and Santa Barbara** are also on this route\n\n**I-5 (fastest, ~6 hours, but not scenic)**\n\n- **Harris Ranch** \u2013 The classic stop for a steak dinner\n- **Casa de Fruta** \u2013 Roadside attraction with snacks and a small train\n\n**Tips:**\n- Check Caltrans for Highway 1 road closures\u2014Big Sur sections sometimes close due to landslides\n- If doing Highway 1, consider an overnight in Monterey/Carmel, Big Sur, or Cambria\n- Fill up on gas before Big Sur; it's expensive and sparse there\n\nWould you like help building a day-by-day itinerary based on how much time you have?" }, "raw_response": { "id": "msg_011CedBqDdZMZFGUp1yQHKL2", "type": "message", "role": "assistant", "content": [ { "type": "thinking", "thinking": "", "signature": "CAQShAUKEAgRGAI4AUIIdGhpbmtpbmcSDIPYwphr/ruEkQm5GRoMi2EZKjsehazJ6il4IjB4hJSu75aNtzCRDW20p3aRVBEl75/aOV5i2an6izSSmbWjhFYvkCSKKvsu6DNM1cwqoQQ0QHB3yemi+cxK105ZiZr2sbYwafT0INKT3HAAvkp8y+Q7o0ro7AZj+6UIUfu9tedn1MFxcGXrh+D8zA9tUXMELTqT4pELiY76hDhkFcCopOoUOCedyQotgDHna+WOdUVKV8BgJaLrvnCYchIHSb0HnWesjzp4GvrOkw3rxfIOl16/W1DTJ638aSYk9ozUMdKxNdyS3OcSvlN7jWiZMOzF6pZ11LTrXOQKy+xWk6Z9TnZ2PoSgBvK2r4xR49xsh+beq0Tq6iYvwUYYMbEOu0xb4t2qHCYJ+80fmyQwxUXdL4fCv0DNuakFX4fzRBOfELrgTDz2LiYm1J2B3Au2KPK/Yet+Qr6KO0G4FOCS5zlGpe9WSVgYzSu/gXm7O1CIrsV6Vfxtq7pv5S/+CL4rwTGJUunzdl8qozMlaJ7uD4kEuK1AMaJ4bcLGxiYDZ1p22pdhtsSGvO1BTb/hPn8PPQfIkEDq8UmRTxCJ+XnfJNAeOeOwB+S9CESoBN85U7yBiPXwvhpgG5uqT1dz9URyMFQHSHbrqoGT3gcilcsYUxzAwA17H5Fvhs1p0/6J0ek21fK/9+3YuryKWHhvM1XFA0uOwZu0xhmatkmLSrmnxEITpP4xHH1OZ2SQUURWn9vjoNLiTAySVKFl26+4nvGcZqDExckEPcBqoU6w7vgFg8nEcHlhs+aSw5S4cNFD5wRizh/iDaZ9+wbkXw5qC/sQ8AtYThgB" }, { "type": "text", "text": "Great choice! Your stops depend on which route you take, so here are the two main options:\n\n**Highway 1 / Pacific Coast Highway (scenic, ~10-12 hours with stops, best over 2 days)**\n\n- **Half Moon Bay** \u2013 Quaint coastal town with good seafood and beaches\n- **Santa Cruz** \u2013 Beach Boardwalk, surfing culture, and redwoods nearby\n- **Monterey** \u2013 World-class aquarium, Cannery Row, and Fisherman's Wharf\n- **17-Mile Drive / Pebble Beach** \u2013 Iconic coastline with the Lone Cypress (small toll)\n- **Carmel-by-the-Sea** \u2013 Charming village with galleries and Carmel Beach\n- **Big Sur** \u2013 The highlight: Bixby Bridge, McWay Falls, Pfeiffer Beach (purple sand), and Nepenthe restaurant for lunch with a view\n- **Hearst Castle (San Simeon)** \u2013 Fascinating mansion tour; the elephant seals at Piedras Blancas nearby are a fun free stop\n- **Cambria / Morro Bay** \u2013 Morro Rock and a laid-back harbor town\n- **San Luis Obispo** \u2013 Great downtown, Bubblegum Alley, and the quirky Madonna Inn\n- **Pismo Beach** \u2013 Classic beach town, good for a break\n- **Solvang** \u2013 A Danish-themed village with pastries and wine tasting\n- **Santa Barbara** \u2013 Beautiful Spanish architecture, State Street, and the waterfront\n- **Malibu** \u2013 Beaches and a final scenic stretch into LA\n\n**US-101 (faster, ~6-7 hours)**\n\n- **Gilroy** \u2013 Garlic capital, outlet shopping\n- **Paso Robles** \u2013 Excellent wine country, less crowded than Napa\n- **San Luis Obispo, Solvang, and Santa Barbara** are also on this route\n\n**I-5 (fastest, ~6 hours, but not scenic)**\n\n- **Harris Ranch** \u2013 The classic stop for a steak dinner\n- **Casa de Fruta** \u2013 Roadside attraction with snacks and a small train\n\n**Tips:**\n- Check Caltrans for Highway 1 road closures\u2014Big Sur sections sometimes close due to landslides\n- If doing Highway 1, consider an overnight in Monterey/Carmel, Big Sur, or Cambria\n- Fill up on gas before Big Sur; it's expensive and sparse there\n\nWould you like help building a day-by-day itinerary based on how much time you have?" } ], "model": "claude-fable-5-1", "stop_reason": "end_turn", "usage": { "input_tokens": 105, "output_tokens": 930 }, "stop_sequence": null, "stop_details": null, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'anthropic/claude-fable-5.1',\n {\n max_tokens: 1024,\n messages: [\n {\n content: 'I need help planning a road trip from San Francisco to Los Angeles.',\n role: 'user',\n },\n {\n content:\n \"I'd be happy to help! The drive is about 380 miles and takes roughly 5-6 hours. Would you like suggestions for scenic routes or interesting stops along the way?\",\n role: 'assistant',\n },\n { content: 'Yes, what are some good places to stop?', role: 'user' },\n ],\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/messages \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"anthropic/claude-fable-5.1\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"content\": \"I need help planning a road trip from San Francisco to Los Angeles.\",\n \"role\": \"user\"\n },\n {\n \"content\": \"I'\\''d be happy to help! The drive is about 380 miles and takes roughly 5-6 hours. Would you like suggestions for scenic routes or interesting stops along the way?\",\n \"role\": \"assistant\"\n },\n {\n \"content\": \"Yes, what are some good places to stop?\",\n \"role\": \"user\"\n }\n ]\n}'" } ] }, { "name": "Streaming Response", "description": "Stream a response for real-time output", "input": { "max_tokens": 1024, "messages": [ { "content": "Explain the concept of recursion with a simple example.", "role": "user" } ], "stream": true }, "output": { "text": [ "**", "Recursion** is a technique where a function solves a problem by calling itself on a smaller version of that same problem, until it reaches a simple case it can answer directly.\n\nEvery recursive function needs two par", "ts:\n\n1. **Base case** \u2013 the simplest input, where the answer is known immediately and no further calls are made. This is what stops the recursion.\n2. **Recursive case** \u2013 the function", " calls itself with a \"smaller\" input, moving toward the base case.\n\n## Example: Factorial\n\nThe factorial of *n* (written *n!*) is *n \u00d7 (n\u2212", "1) \u00d7 (n\u22122) \u00d7 ... \u00d7 1*. For example, 5! = 5 \u00d7 4 \u00d7 3 \u00d7 2 \u00d7 1 = 120.\n\nNotice that 5! is just 5 \u00d7 4!. And 4! is 4 \u00d7 3!. This", " \"defined in terms of itself\" pattern is what makes it recursive.\n\n```python\ndef factorial(n):\n if n == 1: # base case\n return 1\n return n * factorial(n - ", "1) # recursive case\n```\n\nTracing `factorial(4)`:\n\n```\nfactorial(4)\n= 4 * factorial(3)\n= 4 * (3 * factorial(2))\n= 4 * (3 * (2 * factorial(1)))", "\n= 4 * (3 * (2 * 1)) \u2190 base case reached\n= 4 * (3 * 2)\n= 4 * 6\n= 24\n```\n\nThe calls \"stack up\" until the base case is hit, then the results unwind back to", " the original call.\n\n## A real-world analogy\n\nImagine you're in a long line and want to know your position. You ask the person in front of you, \"What", "'s your position?\" They don't know either, so they ask the person in front of *them*. This continues until it reaches the person at the front, who says \"I'm #1\" (base case). Each", " person then adds 1 to the answer they receive and passes it back, until the number reaches you.\n\n## Key things to remember\n\n- **", "Without a base case**, the function calls itself forever (in practice, until the program crashes with a stack overflow).\n- Each recursive call must make progress toward the base case.\n- Recursion is especially natural for problems with self", "-similar structure: traversing trees, exploring directories, parsing nested expressions, or algorithms like merge sort and binary search." ] }, "raw_response": [ { "type": "message_start", "message": { "model": "claude-fable-5-1", "id": "msg_011CedBrJsMHVisMiwBi3NSy", "type": "message", "role": "assistant", "content": [], "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": { "input_tokens": 24, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 }, "output_tokens": 1, "service_tier": "standard", "inference_geo": "global" } } }, { "type": "content_block_start", "index": 0, "content_block": { "type": "text", "text": "" } }, { "type": "ping" }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "**" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "Recursion** is a technique where a function solves a problem by calling itself on a smaller version of that same problem, until it reaches a simple case it can answer directly.\n\nEvery recursive function needs two par" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ts:\n\n1. **Base case** \u2013 the simplest input, where the answer is known immediately and no further calls are made. This is what stops the recursion.\n2. **Recursive case** \u2013 the function" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " calls itself with a \"smaller\" input, moving toward the base case.\n\n## Example: Factorial\n\nThe factorial of *n* (written *n!*) is *n \u00d7 (n\u2212" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "1) \u00d7 (n\u22122) \u00d7 ... \u00d7 1*. For example, 5! = 5 \u00d7 4 \u00d7 3 \u00d7 2 \u00d7 1 = 120.\n\nNotice that 5! is just 5 \u00d7 4!. And 4! is 4 \u00d7 3!. This" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " \"defined in terms of itself\" pattern is what makes it recursive.\n\n```python\ndef factorial(n):\n if n == 1: # base case\n return 1\n return n * factorial(n - " } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "1) # recursive case\n```\n\nTracing `factorial(4)`:\n\n```\nfactorial(4)\n= 4 * factorial(3)\n= 4 * (3 * factorial(2))\n= 4 * (3 * (2 * factorial(1)))" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "\n= 4 * (3 * (2 * 1)) \u2190 base case reached\n= 4 * (3 * 2)\n= 4 * 6\n= 24\n```\n\nThe calls \"stack up\" until the base case is hit, then the results unwind back to" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " the original call.\n\n## A real-world analogy\n\nImagine you're in a long line and want to know your position. You ask the person in front of you, \"What" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "'s your position?\" They don't know either, so they ask the person in front of *them*. This continues until it reaches the person at the front, who says \"I'm #1\" (base case). Each" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " person then adds 1 to the answer they receive and passes it back, until the number reaches you.\n\n## Key things to remember\n\n- **" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "Without a base case**, the function calls itself forever (in practice, until the program crashes with a stack overflow).\n- Each recursive call must make progress toward the base case.\n- Recursion is especially natural for problems with self" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "-similar structure: traversing trees, exploring directories, parsing nested expressions, or algorithms like merge sort and binary search." } }, { "type": "content_block_stop", "index": 0 }, { "type": "message_delta", "delta": { "stop_reason": "end_turn", "stop_sequence": null, "stop_details": null }, "usage": { "input_tokens": 24, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 718, "output_tokens_details": { "thinking_tokens": 0 } } }, { "type": "message_stop" } ], "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'anthropic/claude-fable-5.1',\n {\n max_tokens: 1024,\n messages: [{ content: 'Explain the concept of recursion with a simple example.', role: 'user' }],\n stream: true,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/messages \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"anthropic/claude-fable-5.1\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"content\": \"Explain the concept of recursion with a simple example.\",\n \"role\": \"user\"\n }\n ],\n \"stream\": true\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": false, "zdr_comment": null, "external_info": "https://platform.claude.com/docs/en/about-claude/models/overview", "terms": "https://www.anthropic.com/legal/commercial-terms", "cover_image_url": "https://pub-26f1392c1b674324be6786695bd72257.r2.dev/anthropic/claude-fable-5.1.png", "metadata": { "Adaptive Thinking": "Yes", "Architecture": "Transformer" }, "request_formats": [ "anthropic-messages" ], "providers": null, "provider_details": [ { "id": "anthropic", "pricing": { "input_tokens": 10, "input_cached_tokens": 0.25, "input_cache_creation_tokens": 12.5, "output_tokens": 50 } } ], "banner": null, "created_at": "2026-09-01 22:15:20", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "user", "assistant", "system" ] }, "content": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "text": { "type": "string" }, "source": {}, "cache_control": { "type": "object", "properties": { "type": { "type": "string", "const": "ephemeral" }, "ttl": { "type": "string", "enum": [ "5m", "1h" ] } }, "required": [ "type" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": {} } } ] } }, "required": [ "role", "content" ], "additionalProperties": false } }, "max_tokens": { "type": "number", "exclusiveMinimum": 0 }, "system": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" }, "cache_control": { "type": "object", "properties": { "type": { "type": "string", "const": "ephemeral" }, "ttl": { "type": "string", "enum": [ "5m", "1h" ] } }, "required": [ "type" ], "additionalProperties": false } }, "required": [ "type", "text" ], "additionalProperties": {} } } ] }, "stream": { "type": "boolean" }, "metadata": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "messages", "max_tokens" ], "additionalProperties": {} }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "const": "message" }, "role": { "type": "string", "const": "assistant" }, "content": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "text": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } }, "model": { "type": "string" }, "stop_reason": { "type": [ "string", "null" ] }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "number" }, "output_tokens": { "type": "number" }, "cache_creation_input_tokens": { "type": [ "number", "null" ] }, "cache_read_input_tokens": { "type": [ "number", "null" ] }, "speed": { "type": [ "string", "null" ] } }, "required": [ "input_tokens", "output_tokens" ], "additionalProperties": {} } }, "required": [ "id", "type", "role", "content", "model", "stop_reason", "usage" ], "additionalProperties": {} } } }