{ "model_id": "anthropic/claude-sonnet-5.5", "provider_id": "anthropic", "name": "Claude Sonnet 5.5", "description": "Claude Sonnet 5.5 offers the best combination of speed and intelligence, with adaptive thinking for coding, tool use, reasoning, and long-horizon work.", "task": "Text Generation", "tags": [ "LLM", "Coding", "Reasoning", "Agentic" ], "context_length": 1000000, "max_output_tokens": 128000, "schema_version": "1.0.0", "pricing": { "Input tokens (per 1M)": 2, "Cached input tokens (per 1M)": 0.1, "Cache creation tokens (per 1M)": 2.5, "Output tokens (per 1M)": 10 }, "examples": [ { "name": "System-Guided Explanation", "description": "Use a system message to set a concise technical response style.", "input": { "max_tokens": 1024, "messages": [ { "content": "Explain why database indexes improve lookup performance.", "role": "user" } ], "system": "You are a concise database engineering tutor. Include one concrete example." }, "output": { "text": "**Core idea:** An index is a separate, sorted data structure (usually a B-tree) that lets the database find rows without scanning the entire table.\n\n**Without an index:** To find a row, the database does a *full table scan*, checking every row. Cost grows linearly: O(n).\n\n**With an index:** The database navigates a balanced tree. Each step eliminates a large fraction of the remaining data, so lookup cost is O(log n). Because B-tree nodes hold hundreds of keys, even huge tables are typically only 3\u20134 levels deep, meaning just a few disk/page reads.\n\n**Analogy:** It's like a book's index. Instead of reading every page to find \"photosynthesis,\" you look it up alphabetically and jump straight to the page.\n\n**Concrete example**\n\n```sql\nCREATE TABLE users (\n id INT PRIMARY KEY,\n email VARCHAR(255),\n name VARCHAR(100)\n);\n-- Assume 10 million rows\n\nSELECT * FROM users WHERE email = 'ana@example.com';\n```\n\n- **No index on `email`:** The database reads all 10,000,000 rows to find matches. This may take seconds.\n- **After indexing:**\n ```sql\n CREATE INDEX idx_users_email ON users(email);\n ```\n The database traverses the B-tree on `email` (~3\u20134 page reads), finds a pointer to the matching row, and fetches it directly. This typically takes milliseconds.\n\nYou can verify this with `EXPLAIN`: you'll see a `Seq Scan` / `type: ALL` before, and an `Index Scan` / `type: ref` after.\n\n**Why it works, in short**\n1. Keys are stored **sorted**, enabling binary-search-like navigation.\n2. The tree is **shallow and wide**, minimizing expensive disk I/O.\n3. Leaf entries **point directly** to the row location.\n\n**Tradeoffs:** Indexes consume extra storage and slow down `INSERT`/`UPDATE`/`DELETE`, since the index must be kept in sync. Index columns you frequently filter, join, or sort on, not everything." }, "raw_response": { "model": "claude-sonnet-5-5", "id": "msg_011CfWPzXNFbhjzHxLnrjPAs", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "**Core idea:** An index is a separate, sorted data structure (usually a B-tree) that lets the database find rows without scanning the entire table.\n\n**Without an index:** To find a row, the database does a *full table scan*, checking every row. Cost grows linearly: O(n).\n\n**With an index:** The database navigates a balanced tree. Each step eliminates a large fraction of the remaining data, so lookup cost is O(log n). Because B-tree nodes hold hundreds of keys, even huge tables are typically only 3\u20134 levels deep, meaning just a few disk/page reads.\n\n**Analogy:** It's like a book's index. Instead of reading every page to find \"photosynthesis,\" you look it up alphabetically and jump straight to the page.\n\n**Concrete example**\n\n```sql\nCREATE TABLE users (\n id INT PRIMARY KEY,\n email VARCHAR(255),\n name VARCHAR(100)\n);\n-- Assume 10 million rows\n\nSELECT * FROM users WHERE email = 'ana@example.com';\n```\n\n- **No index on `email`:** The database reads all 10,000,000 rows to find matches. This may take seconds.\n- **After indexing:**\n ```sql\n CREATE INDEX idx_users_email ON users(email);\n ```\n The database traverses the B-tree on `email` (~3\u20134 page reads), finds a pointer to the matching row, and fetches it directly. This typically takes milliseconds.\n\nYou can verify this with `EXPLAIN`: you'll see a `Seq Scan` / `type: ALL` before, and an `Index Scan` / `type: ref` after.\n\n**Why it works, in short**\n1. Keys are stored **sorted**, enabling binary-search-like navigation.\n2. The tree is **shallow and wide**, minimizing expensive disk I/O.\n3. Leaf entries **point directly** to the row location.\n\n**Tradeoffs:** Indexes consume extra storage and slow down `INSERT`/`UPDATE`/`DELETE`, since the index must be kept in sync. Index columns you frequently filter, join, or sort on, not everything." } ], "container": null, "stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "usage": { "input_tokens": 46, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 }, "output_tokens": 705, "output_tokens_details": { "thinking_tokens": 0 }, "service_tier": "standard", "inference_geo": "global" }, "diagnostics": null }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'anthropic/claude-sonnet-5.5',\n {\n max_tokens: 1024,\n messages: [{ content: 'Explain why database indexes improve lookup performance.', role: 'user' }],\n system: 'You are a concise database engineering tutor. Include one concrete example.',\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-sonnet-5.5\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"content\": \"Explain why database indexes improve lookup performance.\",\n \"role\": \"user\"\n }\n ],\n \"system\": \"You are a concise database engineering tutor. Include one concrete example.\"\n}'" } ] }, { "name": "Adaptive Reasoning", "description": "Use adaptive thinking with high effort for a multi-step reasoning task.", "input": { "max_tokens": 2048, "messages": [ { "content": "A service processes 120 jobs per minute. Each retry adds 15% more work, and 8% of jobs retry once. What is the expected number of jobs processed per minute including retries? Show the calculation.", "role": "user" } ], "output_config": { "effort": "high" }, "thinking": { "type": "adaptive" } }, "output": { "text": "**Assumptions:** 120 jobs/min is the base load. 8% of jobs are retried exactly once. Each retry costs 15% more work than the original run, so it counts as 1.15 job-equivalents.\n\n**Calculation**\n\n1. Jobs retried per minute: 120 \u00d7 0.08 = 9.6\n2. Work from retries: 9.6 \u00d7 1.15 = 11.04 job-equivalents\n3. Total: 120 + 11.04 = **131.04 job-equivalents per minute**\n\nThat is about 9.2% more load than the base 120.\n\n**Alternative reading:** If you only want the number of executions and each retry counts as one ordinary job, the total is 120 + 9.6 = **129.6 jobs per minute**. The 15% extra work then doesn't enter the count.\n\nThe first figure (131.04) is the better estimate of capacity needed, since it reflects the heavier cost of retries." }, "raw_response": { "model": "claude-sonnet-5-5", "id": "msg_011CfWPzyhH6mWkQYYXi8zC5", "type": "message", "role": "assistant", "content": [ { "type": "thinking", "thinking": "", "signature": "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" }, { "type": "text", "text": "**Assumptions:** 120 jobs/min is the base load. 8% of jobs are retried exactly once. Each retry costs 15% more work than the original run, so it counts as 1.15 job-equivalents.\n\n**Calculation**\n\n1. Jobs retried per minute: 120 \u00d7 0.08 = 9.6\n2. Work from retries: 9.6 \u00d7 1.15 = 11.04 job-equivalents\n3. Total: 120 + 11.04 = **131.04 job-equivalents per minute**\n\nThat is about 9.2% more load than the base 120.\n\n**Alternative reading:** If you only want the number of executions and each retry counts as one ordinary job, the total is 120 + 9.6 = **129.6 jobs per minute**. The 15% extra work then doesn't enter the count.\n\nThe first figure (131.04) is the better estimate of capacity needed, since it reflects the heavier cost of retries." } ], "container": null, "stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "usage": { "input_tokens": 72, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 }, "output_tokens": 667, "output_tokens_details": { "thinking_tokens": 368 }, "service_tier": "standard", "inference_geo": "global" }, "diagnostics": null }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'anthropic/claude-sonnet-5.5',\n {\n max_tokens: 2048,\n messages: [\n {\n content:\n 'A service processes 120 jobs per minute. Each retry adds 15% more work, and 8% of jobs retry once. What is the expected number of jobs processed per minute including retries? Show the calculation.',\n role: 'user',\n },\n ],\n output_config: { effort: 'high' },\n thinking: { type: 'adaptive' },\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-sonnet-5.5\",\n \"max_tokens\": 2048,\n \"messages\": [\n {\n \"content\": \"A service processes 120 jobs per minute. Each retry adds 15% more work, and 8% of jobs retry once. What is the expected number of jobs processed per minute including retries? Show the calculation.\",\n \"role\": \"user\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\n}'" } ] }, { "name": "Tool Use", "description": "Ask the model to select and call a tool when it needs structured external information.", "input": { "max_tokens": 1024, "messages": [ { "content": "What is the weather in San Francisco right now?", "role": "user" } ], "tools": [ { "description": "Get the current weather for a city.", "input_schema": { "properties": { "city": { "type": "string" } }, "required": [ "city" ], "type": "object" }, "name": "get_weather" } ] }, "error": { "kind": "runner-failure", "message": "normalizer returned empty output \u2014 check modality vs response shape, or recapture", "timestamp": "2026-09-28T19:34:24.420Z" }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'anthropic/claude-sonnet-5.5',\n {\n max_tokens: 1024,\n messages: [{ content: 'What is the weather in San Francisco right now?', role: 'user' }],\n tools: [\n {\n description: 'Get the current weather for a city.',\n input_schema: {\n properties: { city: { type: 'string' } },\n required: ['city'],\n type: 'object',\n },\n name: 'get_weather',\n },\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-sonnet-5.5\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"content\": \"What is the weather in San Francisco right now?\",\n \"role\": \"user\"\n }\n ],\n \"tools\": [\n {\n \"description\": \"Get the current weather for a city.\",\n \"input_schema\": {\n \"properties\": {\n \"city\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"city\"\n ],\n \"type\": \"object\"\n },\n \"name\": \"get_weather\"\n }\n ]\n}'" } ] }, { "name": "Streaming Checklist", "description": "Enable streaming for incremental response delivery.", "input": { "max_tokens": 1024, "messages": [ { "content": "Write a short three-step checklist for reviewing a pull request.", "role": "user" } ], "stream": true }, "output": { "text": [ "# Pull Request Review", " Checklist\n\n1. **", "Understand the int", "ent**\n - Read the", " PR description and lin", "ked issue.\n -", " Confirm the change sol", "ves the st", "ated problem and st", "ays within scope.\n\n2.", " **Review the code**\n ", "- Check for correctness,", " ed", "ge cases, and pot", "ential bugs.\n -", " Look", " for cl", "arity, cons", "istency", " with existing con", "ventions, and un", "necessary complexity.", "\n - Wat", "ch for security,", " performance, or back", "ward", "-compatibility conc", "erns.\n\n3. **", "Verify qu", "ality and give", " feedback**\n -", " Confirm tests ex", "ist,", " are", " me", "aningful, and pass in", " CI.\n - Check", " that doc", "s or", " com", "ments are updated where", " needed.\n - Le", "ave cl", "ear, constructive com", "ments, dist", "inguishing bloc", "king issues from opt", "ional su", "ggestions, then approve or", " request changes." ] }, "raw_response": [ { "type": "message_start", "message": { "model": "claude-sonnet-5-5", "id": "msg_011CfWQ1TEzRFYuStMzD8Fi7", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": { "input_tokens": 28, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cache_creation": { "ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 0 }, "output_tokens": 8, "service_tier": "standard", "inference_geo": "global" }, "diagnostics": null } }, { "type": "content_block_start", "index": 0, "content_block": { "type": "text", "text": "" } }, { "type": "ping" }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "# Pull Request Review" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " Checklist\n\n1. **" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "Understand the int" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ent**\n - Read the" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " PR description and lin" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ked issue.\n -" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " Confirm the change sol" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ves the st" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ated problem and st" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ays within scope.\n\n2." } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " **Review the code**\n " } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "- Check for correctness," } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " ed" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ge cases, and pot" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ential bugs.\n -" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " Look" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " for cl" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "arity, cons" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "istency" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " with existing con" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ventions, and un" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "necessary complexity." } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "\n - Wat" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ch for security," } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " performance, or back" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ward" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "-compatibility conc" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "erns.\n\n3. **" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "Verify qu" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ality and give" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " feedback**\n -" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " Confirm tests ex" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ist," } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " are" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " me" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "aningful, and pass in" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " CI.\n - Check" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " that doc" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "s or" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " com" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ments are updated where" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " needed.\n - Le" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ave cl" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ear, constructive com" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ments, dist" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "inguishing bloc" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "king issues from opt" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ional su" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": "ggestions, then approve or" } }, { "type": "content_block_delta", "index": 0, "delta": { "type": "text_delta", "text": " request changes." } }, { "type": "content_block_stop", "index": 0 }, { "type": "message_delta", "delta": { "stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "container": null }, "usage": { "input_tokens": 28, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 247, "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-sonnet-5.5',\n {\n max_tokens: 1024,\n messages: [\n { content: 'Write a short three-step checklist for reviewing a pull request.', role: 'user' },\n ],\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-sonnet-5.5\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"content\": \"Write a short three-step checklist for reviewing a pull request.\",\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/models/sonnet-5-5/overview", "terms": "https://www.anthropic.com/legal/commercial-terms", "cover_image_url": "https://pub-26f1392c1b674324be6786695bd72257.r2.dev/anthropic/claude-sonnet-5.5.png", "metadata": { "Adaptive Thinking": "Yes", "Architecture": "Transformer", "Input Price": "$2 / MTok", "Output Price": "$10 / MTok", "fedrampAvailable": "true" }, "request_formats": [ "anthropic-messages" ], "providers": null, "provider_details": [ { "id": "anthropic", "pricing": { "input_tokens": 2, "input_cached_tokens": 0.1, "input_cache_creation_tokens": 2.5, "output_tokens": 10 } } ], "banner": null, "created_at": "2026-10-06 18:42: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": {} } } }