{
  "openapi": "3.1.0",
  "info": {
    "title": "Fireworks AI Anthropic Compatible Messages API",
    "description": "Anthropic-compatible Messages API endpoint for Fireworks AI inference",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.fireworks.ai/inference"
    }
  ],
  "paths": {
    "/v1/messages": {
      "post": {
        "summary": "Create a Message",
        "description": "**Anthropic-compatible endpoint.**\n\nSend a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.\n\nThe Messages API can be used for either single queries or stateless multi-turn conversations.\n\n**Fireworks Quickstarts:**\n- [Serverless Quickstart](/getting-started/quickstart)\n- [Deployments Quickstart](/getting-started/ondemand-quickstart)",
        "operationId": "messages_post",
        "responses": {
          "200": {
            "description": "Message object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnthropicMessage"
                }
              }
            }
          },
          "4XX": {
            "description": "Error response.\n\nSee the [errors documentation](/guides/inference-error-codes) for more details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnthropicErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnthropicCreateMessageParams"
              }
            }
          },
          "required": true
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnthropicMessage": {
        "examples": [
          {
            "content": [
              {
                "citations": null,
                "text": "Hi! How can I help you today?",
                "type": "text"
              }
            ],
            "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
            "model": "claude-opus-4-6",
            "role": "assistant",
            "stop_reason": "end_turn",
            "stop_sequence": null,
            "type": "message"
          }
        ],
        "properties": {
          "id": {
            "description": "Unique object identifier.\n\nThe format and length of IDs may change over time.",
            "examples": ["msg_013Zva2CMHLNnXjNJJKqJ2EF"],
            "title": "Id",
            "type": "string"
          },
          "type": {
            "const": "message",
            "default": "message",
            "description": "Object type.\n\nFor Messages, this is always `\"message\"`.",
            "title": "Type",
            "type": "string"
          },
          "role": {
            "const": "assistant",
            "default": "assistant",
            "description": "Conversational role of the generated message.\n\nThis will always be `\"assistant\"`.",
            "title": "Role",
            "type": "string"
          },
          "content": {
            "description": "Content generated by the model.\n\nThis is an array of content blocks, each of which has a `type` that determines its shape.\n\nExample:\n\n```json\n[{\"type\": \"text\", \"text\": \"Hi, I'm here to help.\"}]\n```\n\nIf the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.\n\nFor example, if the input `messages` were:\n```json\n[\n  {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n  {\"role\": \"assistant\", \"content\": \"The best answer is (\"}\n]\n```\n\nThen the response `content` might be:\n\n```json\n[{\"type\": \"text\", \"text\": \"B)\"}]\n```",
            "examples": [
              [
                {
                  "citations": null,
                  "text": "Hi! How can I help you today?",
                  "type": "text"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/AnthropicContentBlock"
            },
            "title": "Content",
            "type": "array"
          },
          "model": {
            "$ref": "#/components/schemas/AnthropicModel"
          },
          "stop_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnthropicStopReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reason that the model stopped.\n\nThis may be one the following values:\n* `\"end_turn\"`: the model reached a natural stopping point\n* `\"max_tokens\"`: the model exceeded the requested `max_tokens` or the model's maximum\n* `\"stop_sequence\"`: one of your provided custom `stop_sequences` was generated\n* `\"tool_use\"`: the model invoked one or more tools\n* `\"pause_turn\"`: the model paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.\n* `\"refusal\"`: when streaming classifiers intervene to handle potential policy violations\n\nIn non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.",
            "title": "Stop Reason"
          },
          "stop_sequence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Which custom stop sequence was generated, if any.\n\nThis value will be a non-null string if one of your custom stop sequences was generated.",
            "title": "Stop Sequence"
          },
          "raw_output": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnthropicRawOutput"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "required": ["id", "type", "role", "content", "model", "stop_reason", "stop_sequence"],
        "title": "Message",
        "type": "object",
        "x-stainless-python-custom-imports": ["from .content_block import ContentBlock as ContentBlock"]
      },
      "AnthropicContentBlock": {
        "discriminator": {
          "mapping": {
            "redacted_thinking": "#/components/schemas/AnthropicResponseRedactedThinkingBlock",
            "text": "#/components/schemas/AnthropicResponseTextBlock",
            "thinking": "#/components/schemas/AnthropicResponseThinkingBlock",
            "tool_use": "#/components/schemas/AnthropicResponseToolUseBlock"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AnthropicResponseTextBlock"
          },
          {
            "$ref": "#/components/schemas/AnthropicResponseThinkingBlock"
          },
          {
            "$ref": "#/components/schemas/AnthropicResponseRedactedThinkingBlock"
          },
          {
            "$ref": "#/components/schemas/AnthropicResponseToolUseBlock"
          }
        ]
      },
      "AnthropicResponseTextBlock": {
        "properties": {
          "citations": {
            "anyOf": [
              {
                "items": {
                  "discriminator": {
                    "mapping": {
                      "char_location": "#/components/schemas/AnthropicResponseCharLocationCitation",
                      "content_block_location": "#/components/schemas/AnthropicResponseContentBlockLocationCitation",
                      "page_location": "#/components/schemas/AnthropicResponsePageLocationCitation",
                      "search_result_location": "#/components/schemas/AnthropicResponseSearchResultLocationCitation",
                      "web_search_result_location": "#/components/schemas/AnthropicResponseWebSearchResultLocationCitation"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AnthropicResponseCharLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicResponsePageLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicResponseContentBlockLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicResponseWebSearchResultLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicResponseSearchResultLocationCitation"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Citations supporting the text block.\n\nThe type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.",
            "title": "Citations"
          },
          "text": {
            "maxLength": 5000000,
            "minLength": 0,
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "text",
            "default": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["citations", "text", "type"],
        "title": "ResponseTextBlock",
        "type": "object"
      },
      "AnthropicResponseCharLocationCitation": {
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "document_index": {
            "minimum": 0,
            "title": "Document Index",
            "type": "integer"
          },
          "document_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title"
          },
          "end_char_index": {
            "title": "End Char Index",
            "type": "integer"
          },
          "file_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "File Id"
          },
          "start_char_index": {
            "minimum": 0,
            "title": "Start Char Index",
            "type": "integer"
          },
          "type": {
            "const": "char_location",
            "default": "char_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "cited_text",
          "document_index",
          "document_title",
          "end_char_index",
          "file_id",
          "start_char_index",
          "type"
        ],
        "title": "ResponseCharLocationCitation",
        "type": "object"
      },
      "AnthropicResponsePageLocationCitation": {
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "document_index": {
            "minimum": 0,
            "title": "Document Index",
            "type": "integer"
          },
          "document_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title"
          },
          "end_page_number": {
            "title": "End Page Number",
            "type": "integer"
          },
          "file_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "File Id"
          },
          "start_page_number": {
            "minimum": 1,
            "title": "Start Page Number",
            "type": "integer"
          },
          "type": {
            "const": "page_location",
            "default": "page_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "cited_text",
          "document_index",
          "document_title",
          "end_page_number",
          "file_id",
          "start_page_number",
          "type"
        ],
        "title": "ResponsePageLocationCitation",
        "type": "object"
      },
      "AnthropicResponseContentBlockLocationCitation": {
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "document_index": {
            "minimum": 0,
            "title": "Document Index",
            "type": "integer"
          },
          "document_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title"
          },
          "end_block_index": {
            "title": "End Block Index",
            "type": "integer"
          },
          "file_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "File Id"
          },
          "start_block_index": {
            "minimum": 0,
            "title": "Start Block Index",
            "type": "integer"
          },
          "type": {
            "const": "content_block_location",
            "default": "content_block_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "cited_text",
          "document_index",
          "document_title",
          "end_block_index",
          "file_id",
          "start_block_index",
          "type"
        ],
        "title": "ResponseContentBlockLocationCitation",
        "type": "object"
      },
      "AnthropicResponseWebSearchResultLocationCitation": {
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "encrypted_index": {
            "title": "Encrypted Index",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "type": {
            "const": "web_search_result_location",
            "default": "web_search_result_location",
            "title": "Type",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": ["cited_text", "encrypted_index", "title", "type", "url"],
        "title": "ResponseWebSearchResultLocationCitation",
        "type": "object"
      },
      "AnthropicResponseSearchResultLocationCitation": {
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "end_block_index": {
            "title": "End Block Index",
            "type": "integer"
          },
          "search_result_index": {
            "minimum": 0,
            "title": "Search Result Index",
            "type": "integer"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "start_block_index": {
            "minimum": 0,
            "title": "Start Block Index",
            "type": "integer"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "type": {
            "const": "search_result_location",
            "default": "search_result_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "cited_text",
          "end_block_index",
          "search_result_index",
          "source",
          "start_block_index",
          "title",
          "type"
        ],
        "title": "ResponseSearchResultLocationCitation",
        "type": "object"
      },
      "AnthropicResponseThinkingBlock": {
        "properties": {
          "signature": {
            "title": "Signature",
            "type": "string"
          },
          "thinking": {
            "title": "Thinking",
            "type": "string"
          },
          "type": {
            "const": "thinking",
            "default": "thinking",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["signature", "thinking", "type"],
        "title": "ResponseThinkingBlock",
        "type": "object"
      },
      "AnthropicResponseRedactedThinkingBlock": {
        "properties": {
          "data": {
            "title": "Data",
            "type": "string"
          },
          "type": {
            "const": "redacted_thinking",
            "default": "redacted_thinking",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["data", "type"],
        "title": "ResponseRedactedThinkingBlock",
        "type": "object"
      },
      "AnthropicResponseToolUseBlock": {
        "properties": {
          "id": {
            "pattern": "^[a-zA-Z0-9_-]+$",
            "title": "Id",
            "type": "string"
          },
          "input": {
            "additionalProperties": true,
            "title": "Input",
            "type": "object"
          },
          "name": {
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "type": {
            "const": "tool_use",
            "default": "tool_use",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["id", "input", "name", "type"],
        "title": "ResponseToolUseBlock",
        "type": "object"
      },
      "AnthropicBase64PDFSource": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "format": "byte",
            "title": "Data",
            "type": "string"
          },
          "media_type": {
            "const": "application/pdf",
            "title": "Media Type",
            "type": "string"
          },
          "type": {
            "const": "base64",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["data", "media_type", "type"],
        "title": "Base64PDFSource",
        "type": "object"
      },
      "AnthropicPlainTextSource": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "title": "Data",
            "type": "string"
          },
          "media_type": {
            "const": "text/plain",
            "title": "Media Type",
            "type": "string"
          },
          "type": {
            "const": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["data", "media_type", "type"],
        "title": "PlainTextSource",
        "type": "object"
      },
      "AnthropicModel": {
        "type": "string",
        "title": "Model",
        "description": "The model that will complete your prompt. See the [Fireworks Model Library](https://app.fireworks.ai/models) for available models."
      },
      "AnthropicStopReason": {
        "enum": ["end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal"],
        "type": "string"
      },
      "AnthropicErrorResponse": {
        "properties": {
          "error": {
            "discriminator": {
              "mapping": {
                "api_error": "#/components/schemas/AnthropicAPIError",
                "authentication_error": "#/components/schemas/AnthropicAuthenticationError",
                "billing_error": "#/components/schemas/AnthropicBillingError",
                "invalid_request_error": "#/components/schemas/AnthropicInvalidRequestError",
                "not_found_error": "#/components/schemas/AnthropicNotFoundError",
                "overloaded_error": "#/components/schemas/AnthropicOverloadedError",
                "permission_error": "#/components/schemas/AnthropicPermissionError",
                "rate_limit_error": "#/components/schemas/AnthropicRateLimitError",
                "timeout_error": "#/components/schemas/AnthropicGatewayTimeoutError"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/AnthropicInvalidRequestError"
              },
              {
                "$ref": "#/components/schemas/AnthropicAuthenticationError"
              },
              {
                "$ref": "#/components/schemas/AnthropicBillingError"
              },
              {
                "$ref": "#/components/schemas/AnthropicPermissionError"
              },
              {
                "$ref": "#/components/schemas/AnthropicNotFoundError"
              },
              {
                "$ref": "#/components/schemas/AnthropicRateLimitError"
              },
              {
                "$ref": "#/components/schemas/AnthropicGatewayTimeoutError"
              },
              {
                "$ref": "#/components/schemas/AnthropicAPIError"
              },
              {
                "$ref": "#/components/schemas/AnthropicOverloadedError"
              }
            ],
            "title": "Error"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Request Id"
          },
          "type": {
            "const": "error",
            "default": "error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["error", "request_id", "type"],
        "title": "ErrorResponse",
        "type": "object"
      },
      "AnthropicInvalidRequestError": {
        "properties": {
          "message": {
            "default": "Invalid request",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "invalid_request_error",
            "default": "invalid_request_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "InvalidRequestError",
        "type": "object"
      },
      "AnthropicAuthenticationError": {
        "properties": {
          "message": {
            "default": "Authentication error",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "authentication_error",
            "default": "authentication_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "AuthenticationError",
        "type": "object"
      },
      "AnthropicBillingError": {
        "properties": {
          "message": {
            "default": "Billing error",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "billing_error",
            "default": "billing_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "BillingError",
        "type": "object"
      },
      "AnthropicPermissionError": {
        "properties": {
          "message": {
            "default": "Permission denied",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "permission_error",
            "default": "permission_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "PermissionError",
        "type": "object"
      },
      "AnthropicNotFoundError": {
        "properties": {
          "message": {
            "default": "Not found",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "not_found_error",
            "default": "not_found_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "NotFoundError",
        "type": "object"
      },
      "AnthropicRateLimitError": {
        "properties": {
          "message": {
            "default": "Rate limited",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "rate_limit_error",
            "default": "rate_limit_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "RateLimitError",
        "type": "object"
      },
      "AnthropicGatewayTimeoutError": {
        "properties": {
          "message": {
            "default": "Request timeout",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "timeout_error",
            "default": "timeout_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "GatewayTimeoutError",
        "type": "object"
      },
      "AnthropicAPIError": {
        "properties": {
          "message": {
            "default": "Internal server error",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "api_error",
            "default": "api_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "APIError",
        "type": "object"
      },
      "AnthropicOverloadedError": {
        "properties": {
          "message": {
            "default": "Overloaded",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "overloaded_error",
            "default": "overloaded_error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["message", "type"],
        "title": "OverloadedError",
        "type": "object"
      },
      "AnthropicCreateMessageParams": {
        "additionalProperties": false,
        "example": {
          "max_tokens": 1024,
          "messages": [
            {
              "content": "Hello, world",
              "role": "user"
            }
          ],
          "model": "claude-opus-4-6"
        },
        "properties": {
          "model": {
            "$ref": "#/components/schemas/AnthropicModel"
          },
          "messages": {
            "description": "Input messages.\n\nModels are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.\n\nEach input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.\n\nIf the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.\n\nExample with a single `user` message:\n\n```json\n[{\"role\": \"user\", \"content\": \"Hello\"}]\n```\n\nExample with multiple conversational turns:\n\n```json\n[\n  {\"role\": \"user\", \"content\": \"Hello there.\"},\n  {\"role\": \"assistant\", \"content\": \"Hi, I'm here to help. How can I help you?\"},\n  {\"role\": \"user\", \"content\": \"Can you explain LLMs in plain English?\"},\n]\n```\n\nExample with a partially-filled response from the model:\n\n```json\n[\n  {\"role\": \"user\", \"content\": \"What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun\"},\n  {\"role\": \"assistant\", \"content\": \"The best answer is (\"},\n]\n```\n\nEach input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `\"text\"`. The following input messages are equivalent:\n\n```json\n{\"role\": \"user\", \"content\": \"Hello\"}\n```\n\n```json\n{\"role\": \"user\", \"content\": [{\"type\": \"text\", \"text\": \"Hello\"}]}\n```\n\nSee [input examples](https://docs.claude.com/en/api/messages-examples).\n\nNote that if you want to include a [system prompt](/guides/querying-text-models), you can use the top-level `system` parameter \u2014 there is no `\"system\"` role for input messages in the Messages API.\n\nThere is a limit of 100,000 messages in a single request.",
            "items": {
              "$ref": "#/components/schemas/AnthropicInputMessage"
            },
            "title": "Messages",
            "type": "array"
          },
          "max_tokens": {
            "description": "The maximum number of tokens to generate before stopping.\n\nNote that models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n\nDifferent models have different maximum values for this parameter.  See [models](https://app.fireworks.ai/models) for details.",
            "examples": [1024],
            "minimum": 1,
            "title": "Max Tokens",
            "type": "integer"
          },
          "metadata": {
            "$ref": "#/components/schemas/AnthropicMetadata",
            "description": "An object describing metadata about the request."
          },
          "output_config": {
            "$ref": "#/components/schemas/AnthropicOutputConfig",
            "description": "Configuration options for the model's output, such as the output format."
          },
          "stop_sequences": {
            "description": "Custom text sequences that will cause the model to stop generating.\n\nModels will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `\"end_turn\"`.\n\nIf you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `\"stop_sequence\"` and the response `stop_sequence` value will contain the matched stop sequence.",
            "items": {
              "type": "string"
            },
            "title": "Stop Sequences",
            "type": "array"
          },
          "stream": {
            "description": "Whether to incrementally stream the response using server-sent events.\n\nSee [streaming](/guides/querying-text-models) for details.",
            "title": "Stream",
            "type": "boolean"
          },
          "system": {
            "anyOf": [
              {
                "type": "string",
                "x-stainless-skip": ["go", "cli"]
              },
              {
                "items": {
                  "$ref": "#/components/schemas/AnthropicRequestTextBlock"
                },
                "type": "array"
              }
            ],
            "description": "System prompt.\n\nA system prompt is a way of providing context and instructions to the model, such as specifying a particular goal or role. See the [guide to system prompts](/guides/querying-text-models).",
            "examples": [
              [
                {
                  "text": "Today's date is 2024-06-01.",
                  "type": "text"
                }
              ],
              "Today's date is 2023-01-01."
            ],
            "title": "System"
          },
          "temperature": {
            "description": "Amount of randomness injected into the response.\n\nDefaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.\n\nNote that even with `temperature` of `0.0`, the results will not be fully deterministic.",
            "examples": [1],
            "maximum": 1,
            "minimum": 0,
            "title": "Temperature",
            "type": "number"
          },
          "thinking": {
            "$ref": "#/components/schemas/AnthropicThinkingConfigParam"
          },
          "tool_choice": {
            "$ref": "#/components/schemas/AnthropicToolChoice"
          },
          "tools": {
            "description": "Definitions of tools that the model may use.\n\nIf you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.\n\nEach tool definition includes:\n\n* `name`: Name of the tool.\n* `description`: Optional, but strongly-recommended description of the tool.\n* `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.\n\nFor example, if you defined `tools` as:\n\n```json\n[\n  {\n    \"name\": \"get_stock_price\",\n    \"description\": \"Get the current stock price for a given ticker symbol.\",\n    \"input_schema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"ticker\": {\n          \"type\": \"string\",\n          \"description\": \"The stock ticker symbol, e.g. AAPL for Apple Inc.\"\n        }\n      },\n      \"required\": [\"ticker\"]\n    }\n  }\n]\n```\n\nAnd then asked the model \"What's the S&P 500 at today?\", the model might produce `tool_use` content blocks in the response like this:\n\n```json\n[\n  {\n    \"type\": \"tool_use\",\n    \"id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n    \"name\": \"get_stock_price\",\n    \"input\": { \"ticker\": \"^GSPC\" }\n  }\n]\n```\n\nYou might then run your `get_stock_price` tool with `{\"ticker\": \"^GSPC\"}` as an input, and return the following back to the model in a subsequent `user` message:\n\n```json\n[\n  {\n    \"type\": \"tool_result\",\n    \"tool_use_id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n    \"content\": \"259.75 USD\"\n  }\n]\n```\n\nTools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.\n\nSee the [guide](/guides/function-calling) for more details.",
            "examples": [
              {
                "description": "Get the current weather in a given location",
                "input_schema": {
                  "properties": {
                    "location": {
                      "description": "The city and state, e.g. San Francisco, CA",
                      "type": "string"
                    },
                    "unit": {
                      "description": "Unit for the output - one of (celsius, fahrenheit)",
                      "type": "string"
                    }
                  },
                  "required": ["location"],
                  "type": "object"
                },
                "name": "get_weather"
              }
            ],
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AnthropicTool"
                }
              ]
            },
            "title": "Tools",
            "type": "array"
          },
          "top_k": {
            "description": "Only sample from the top K options for each subsequent token.\n\nUsed to remove \"long tail\" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).\n\nRecommended for advanced use cases only. You usually only need to use `temperature`.",
            "examples": [5],
            "minimum": 0,
            "title": "Top K",
            "type": "integer"
          },
          "top_p": {
            "description": "Use nucleus sampling.\n\nIn nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.\n\nRecommended for advanced use cases only. You usually only need to use `temperature`.",
            "examples": [0.7],
            "maximum": 1,
            "minimum": 0,
            "title": "Top P",
            "type": "number"
          },
          "raw_output": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Raw Output",
            "description": "Return raw output from the model.",
            "default": false
          }
        },
        "required": ["model", "messages"],
        "title": "CreateMessageParams",
        "type": "object"
      },
      "AnthropicInputMessage": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string",
                "x-stainless-skip": ["go", "cli"]
              },
              {
                "items": {
                  "$ref": "#/components/schemas/AnthropicInputContentBlock"
                },
                "type": "array",
                "example": [
                  {
                    "type": "text",
                    "text": "What is a quaternion?"
                  }
                ]
              }
            ],
            "title": "Content"
          },
          "role": {
            "enum": ["user", "assistant"],
            "title": "Role",
            "type": "string"
          }
        },
        "required": ["content", "role"],
        "title": "InputMessage",
        "type": "object",
        "discriminator": {
          "propertyName": "role"
        }
      },
      "AnthropicInputContentBlock": {
        "discriminator": {
          "mapping": {
            "document": "#/components/schemas/AnthropicRequestDocumentBlock",
            "image": "#/components/schemas/AnthropicRequestImageBlock",
            "redacted_thinking": "#/components/schemas/AnthropicRequestRedactedThinkingBlock",
            "text": "#/components/schemas/AnthropicRequestTextBlock",
            "thinking": "#/components/schemas/AnthropicRequestThinkingBlock",
            "tool_result": "#/components/schemas/AnthropicRequestToolResultBlock",
            "tool_use": "#/components/schemas/AnthropicRequestToolUseBlock"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AnthropicRequestTextBlock",
            "description": "Regular text content."
          },
          {
            "$ref": "#/components/schemas/AnthropicRequestImageBlock",
            "description": "Image content specified directly as base64 data or as a reference via a URL."
          },
          {
            "$ref": "#/components/schemas/AnthropicRequestDocumentBlock",
            "description": "Document content, either specified directly as base64 data, as text, or as a reference via a URL."
          },
          {
            "$ref": "#/components/schemas/AnthropicRequestThinkingBlock",
            "description": "A block specifying internal thinking by the model."
          },
          {
            "$ref": "#/components/schemas/AnthropicRequestRedactedThinkingBlock",
            "description": "A block specifying internal, redacted thinking by the model."
          },
          {
            "$ref": "#/components/schemas/AnthropicRequestToolUseBlock",
            "description": "A block indicating a tool use by the model."
          },
          {
            "$ref": "#/components/schemas/AnthropicRequestToolResultBlock",
            "description": "A block specifying the results of a tool use by the model."
          }
        ],
        "x-stainless-python-extend-union": ["ContentBlock"],
        "x-stainless-python-extend-union-imports": ["from .content_block import ContentBlock"],
        "x-stainless-go-variant-constructor": {
          "naming": "new_{variant}_block"
        }
      },
      "AnthropicRequestTextBlock": {
        "additionalProperties": false,
        "properties": {
          "cache_control": {
            "anyOf": [
              {
                "discriminator": {
                  "mapping": {
                    "ephemeral": "#/components/schemas/AnthropicCacheControlEphemeral"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AnthropicCacheControlEphemeral"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Create a cache control breakpoint at this content block.",
            "title": "Cache Control"
          },
          "citations": {
            "anyOf": [
              {
                "items": {
                  "discriminator": {
                    "mapping": {
                      "char_location": "#/components/schemas/AnthropicRequestCharLocationCitation",
                      "content_block_location": "#/components/schemas/AnthropicRequestContentBlockLocationCitation",
                      "page_location": "#/components/schemas/AnthropicRequestPageLocationCitation",
                      "search_result_location": "#/components/schemas/AnthropicRequestSearchResultLocationCitation",
                      "web_search_result_location": "#/components/schemas/AnthropicRequestWebSearchResultLocationCitation"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AnthropicRequestCharLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestPageLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestContentBlockLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestWebSearchResultLocationCitation"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestSearchResultLocationCitation"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Citations"
          },
          "text": {
            "minLength": 1,
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["text", "type"],
        "title": "RequestTextBlock",
        "type": "object"
      },
      "AnthropicCacheControlEphemeral": {
        "additionalProperties": false,
        "properties": {
          "ttl": {
            "description": "The time-to-live for the cache control breakpoint.\n\nThis may be one the following values:\n- `5m`: 5 minutes\n- `1h`: 1 hour\n\nDefaults to `5m`.",
            "enum": ["5m", "1h"],
            "title": "Ttl",
            "type": "string",
            "x-stainless-renameMap": {
              "ttl_5m": "5m",
              "ttl_1h": "1h"
            }
          },
          "type": {
            "const": "ephemeral",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "CacheControlEphemeral",
        "type": "object",
        "x-stainless-go-constant-constructor": true
      },
      "AnthropicRequestCharLocationCitation": {
        "additionalProperties": false,
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "document_index": {
            "minimum": 0,
            "title": "Document Index",
            "type": "integer"
          },
          "document_title": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title"
          },
          "end_char_index": {
            "title": "End Char Index",
            "type": "integer"
          },
          "start_char_index": {
            "minimum": 0,
            "title": "Start Char Index",
            "type": "integer"
          },
          "type": {
            "const": "char_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["cited_text", "document_index", "document_title", "end_char_index", "start_char_index", "type"],
        "title": "RequestCharLocationCitation",
        "type": "object"
      },
      "AnthropicRequestPageLocationCitation": {
        "additionalProperties": false,
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "document_index": {
            "minimum": 0,
            "title": "Document Index",
            "type": "integer"
          },
          "document_title": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title"
          },
          "end_page_number": {
            "title": "End Page Number",
            "type": "integer"
          },
          "start_page_number": {
            "minimum": 1,
            "title": "Start Page Number",
            "type": "integer"
          },
          "type": {
            "const": "page_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["cited_text", "document_index", "document_title", "end_page_number", "start_page_number", "type"],
        "title": "RequestPageLocationCitation",
        "type": "object"
      },
      "AnthropicRequestContentBlockLocationCitation": {
        "additionalProperties": false,
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "document_index": {
            "minimum": 0,
            "title": "Document Index",
            "type": "integer"
          },
          "document_title": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title"
          },
          "end_block_index": {
            "title": "End Block Index",
            "type": "integer"
          },
          "start_block_index": {
            "minimum": 0,
            "title": "Start Block Index",
            "type": "integer"
          },
          "type": {
            "const": "content_block_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["cited_text", "document_index", "document_title", "end_block_index", "start_block_index", "type"],
        "title": "RequestContentBlockLocationCitation",
        "type": "object"
      },
      "AnthropicRequestWebSearchResultLocationCitation": {
        "additionalProperties": false,
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "encrypted_index": {
            "title": "Encrypted Index",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "type": {
            "const": "web_search_result_location",
            "title": "Type",
            "type": "string"
          },
          "url": {
            "maxLength": 2048,
            "minLength": 1,
            "title": "Url",
            "type": "string"
          }
        },
        "required": ["cited_text", "encrypted_index", "title", "type", "url"],
        "title": "RequestWebSearchResultLocationCitation",
        "type": "object"
      },
      "AnthropicRequestSearchResultLocationCitation": {
        "additionalProperties": false,
        "properties": {
          "cited_text": {
            "title": "Cited Text",
            "type": "string"
          },
          "end_block_index": {
            "title": "End Block Index",
            "type": "integer"
          },
          "search_result_index": {
            "minimum": 0,
            "title": "Search Result Index",
            "type": "integer"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "start_block_index": {
            "minimum": 0,
            "title": "Start Block Index",
            "type": "integer"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "type": {
            "const": "search_result_location",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "cited_text",
          "end_block_index",
          "search_result_index",
          "source",
          "start_block_index",
          "title",
          "type"
        ],
        "title": "RequestSearchResultLocationCitation",
        "type": "object"
      },
      "AnthropicRequestImageBlock": {
        "additionalProperties": false,
        "properties": {
          "cache_control": {
            "anyOf": [
              {
                "discriminator": {
                  "mapping": {
                    "ephemeral": "#/components/schemas/AnthropicCacheControlEphemeral"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AnthropicCacheControlEphemeral"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Create a cache control breakpoint at this content block.",
            "title": "Cache Control"
          },
          "source": {
            "discriminator": {
              "mapping": {
                "base64": "#/components/schemas/AnthropicBase64ImageSource",
                "url": "#/components/schemas/AnthropicURLImageSource"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/AnthropicBase64ImageSource"
              },
              {
                "$ref": "#/components/schemas/AnthropicURLImageSource"
              }
            ],
            "title": "Source"
          },
          "type": {
            "const": "image",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["source", "type"],
        "title": "RequestImageBlock",
        "type": "object"
      },
      "AnthropicBase64ImageSource": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "format": "byte",
            "title": "Data",
            "type": "string"
          },
          "media_type": {
            "enum": ["image/jpeg", "image/png", "image/gif", "image/webp"],
            "title": "Media Type",
            "type": "string"
          },
          "type": {
            "const": "base64",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["data", "media_type", "type"],
        "title": "Base64ImageSource",
        "type": "object"
      },
      "AnthropicURLImageSource": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "url",
            "title": "Type",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": ["type", "url"],
        "title": "URLImageSource",
        "type": "object"
      },
      "AnthropicRequestDocumentBlock": {
        "additionalProperties": false,
        "properties": {
          "cache_control": {
            "anyOf": [
              {
                "discriminator": {
                  "mapping": {
                    "ephemeral": "#/components/schemas/AnthropicCacheControlEphemeral"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AnthropicCacheControlEphemeral"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Create a cache control breakpoint at this content block.",
            "title": "Cache Control"
          },
          "citations": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnthropicRequestCitationsConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "context": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          },
          "source": {
            "discriminator": {
              "mapping": {
                "base64": "#/components/schemas/AnthropicBase64PDFSource",
                "content": "#/components/schemas/AnthropicContentBlockSource",
                "text": "#/components/schemas/AnthropicPlainTextSource",
                "url": "#/components/schemas/AnthropicURLPDFSource"
              },
              "propertyName": "type"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/AnthropicBase64PDFSource"
              },
              {
                "$ref": "#/components/schemas/AnthropicPlainTextSource"
              },
              {
                "$ref": "#/components/schemas/AnthropicContentBlockSource"
              },
              {
                "$ref": "#/components/schemas/AnthropicURLPDFSource"
              }
            ],
            "title": "Source"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "type": {
            "const": "document",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["source", "type"],
        "title": "RequestDocumentBlock",
        "type": "object"
      },
      "AnthropicRequestCitationsConfig": {
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          }
        },
        "title": "RequestCitationsConfig",
        "type": "object"
      },
      "AnthropicContentBlockSource": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "discriminator": {
                    "mapping": {
                      "image": "#/components/schemas/AnthropicRequestImageBlock",
                      "text": "#/components/schemas/AnthropicRequestTextBlock"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AnthropicRequestTextBlock"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestImageBlock"
                    }
                  ],
                  "x-stainless-naming": {
                    "go": {
                      "type_name": "ContentBlockSourceContentItem"
                    }
                  },
                  "title": "content_block_source_content_item"
                },
                "type": "array",
                "title": "content_block_source_content"
              }
            ],
            "title": "Content"
          },
          "type": {
            "const": "content",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["content", "type"],
        "title": "ContentBlockSource",
        "type": "object"
      },
      "AnthropicURLPDFSource": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "url",
            "title": "Type",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": ["type", "url"],
        "title": "URLPDFSource",
        "type": "object"
      },
      "AnthropicRequestThinkingBlock": {
        "additionalProperties": false,
        "properties": {
          "signature": {
            "title": "Signature",
            "type": "string"
          },
          "thinking": {
            "title": "Thinking",
            "type": "string"
          },
          "type": {
            "const": "thinking",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["signature", "thinking", "type"],
        "title": "RequestThinkingBlock",
        "type": "object"
      },
      "AnthropicRequestRedactedThinkingBlock": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "title": "Data",
            "type": "string"
          },
          "type": {
            "const": "redacted_thinking",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["data", "type"],
        "title": "RequestRedactedThinkingBlock",
        "type": "object"
      },
      "AnthropicRequestToolUseBlock": {
        "additionalProperties": false,
        "properties": {
          "cache_control": {
            "anyOf": [
              {
                "discriminator": {
                  "mapping": {
                    "ephemeral": "#/components/schemas/AnthropicCacheControlEphemeral"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AnthropicCacheControlEphemeral"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Create a cache control breakpoint at this content block.",
            "title": "Cache Control"
          },
          "id": {
            "pattern": "^[a-zA-Z0-9_-]+$",
            "title": "Id",
            "type": "string"
          },
          "input": {
            "additionalProperties": true,
            "title": "Input",
            "type": "object"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "type": {
            "const": "tool_use",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["id", "input", "name", "type"],
        "title": "RequestToolUseBlock",
        "type": "object"
      },
      "AnthropicRequestToolResultBlock": {
        "additionalProperties": false,
        "properties": {
          "cache_control": {
            "anyOf": [
              {
                "discriminator": {
                  "mapping": {
                    "ephemeral": "#/components/schemas/AnthropicCacheControlEphemeral"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AnthropicCacheControlEphemeral"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Create a cache control breakpoint at this content block.",
            "title": "Cache Control"
          },
          "content": {
            "anyOf": [
              {
                "type": "string",
                "x-stainless-skip": ["go", "cli"]
              },
              {
                "items": {
                  "discriminator": {
                    "mapping": {
                      "document": "#/components/schemas/AnthropicRequestDocumentBlock",
                      "image": "#/components/schemas/AnthropicRequestImageBlock",
                      "text": "#/components/schemas/AnthropicRequestTextBlock"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AnthropicRequestTextBlock"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestImageBlock"
                    },
                    {
                      "$ref": "#/components/schemas/AnthropicRequestDocumentBlock"
                    }
                  ],
                  "title": "Block"
                },
                "type": "array",
                "x-stainless-naming": {
                  "python": {
                    "type_name": "Content"
                  },
                  "ruby": {
                    "type_name": "Content"
                  },
                  "php": {
                    "type_name": "Content"
                  }
                }
              }
            ],
            "title": "Content"
          },
          "is_error": {
            "title": "Is Error",
            "type": "boolean"
          },
          "tool_use_id": {
            "pattern": "^[a-zA-Z0-9_-]+$",
            "title": "Tool Use Id",
            "type": "string"
          },
          "type": {
            "const": "tool_result",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["tool_use_id", "type"],
        "title": "RequestToolResultBlock",
        "type": "object"
      },
      "AnthropicMetadata": {
        "additionalProperties": false,
        "properties": {
          "user_id": {
            "anyOf": [
              {
                "maxLength": 256,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "An external identifier for the user who is associated with the request.\n\nThis should be a uuid, hash value, or other opaque identifier. This id may be used to help detect abuse. Do not include any identifying information such as name, email address, or phone number.",
            "examples": ["13803d75-b4b5-4c3e-b2a2-6f21399b021b"],
            "title": "User Id"
          }
        },
        "title": "Metadata",
        "type": "object"
      },
      "AnthropicOutputConfig": {
        "additionalProperties": false,
        "properties": {
          "effort": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnthropicEffortLevel"
              },
              {
                "type": "null"
              }
            ],
            "description": "How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.\n\nValid values are `low`, `medium`, `high`, or `max`.\n\n**Fireworks behavior:** The `effort` level is converted to Fireworks [`reasoning_effort`](/api-reference/post-chatcompletions). Values `low`, `medium`, and `high` map directly. `max` is mapped to `high` since Fireworks does not have a `max` effort level."
          },
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnthropicJsonOutputFormat"
              },
              {
                "type": "null"
              }
            ],
            "description": "A schema to specify the model's output format in responses. See [structured outputs](/structured-responses/structured-output-grammar-based)"
          }
        },
        "title": "OutputConfig",
        "type": "object"
      },
      "AnthropicEffortLevel": {
        "description": "All possible effort levels.",
        "enum": ["low", "medium", "high", "max"],
        "title": "EffortLevel",
        "type": "string"
      },
      "AnthropicJsonOutputFormat": {
        "additionalProperties": false,
        "properties": {
          "schema": {
            "additionalProperties": true,
            "description": "The JSON schema of the format",
            "title": "Schema",
            "type": "object"
          },
          "type": {
            "const": "json_schema",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["schema", "type"],
        "title": "JsonOutputFormat",
        "type": "object"
      },
      "AnthropicThinkingConfigParam": {
        "description": "Configuration for enabling the model's extended thinking.\n\nWhen enabled, responses include `thinking` content blocks showing the model's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit.\n\nSee [reasoning](/guides/reasoning) for details.\n\n**Note:** The `adaptive` thinking type is not supported yet.",
        "discriminator": {
          "mapping": {
            "adaptive": "#/components/schemas/AnthropicThinkingConfigAdaptive",
            "disabled": "#/components/schemas/AnthropicThinkingConfigDisabled",
            "enabled": "#/components/schemas/AnthropicThinkingConfigEnabled"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AnthropicThinkingConfigEnabled"
          },
          {
            "$ref": "#/components/schemas/AnthropicThinkingConfigDisabled"
          },
          {
            "$ref": "#/components/schemas/AnthropicThinkingConfigAdaptive"
          }
        ],
        "title": "Thinking"
      },
      "AnthropicThinkingConfigEnabled": {
        "additionalProperties": false,
        "properties": {
          "budget_tokens": {
            "description": "Determines how many tokens the model can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.\n\nMust be \u22651024 and less than `max_tokens`.\n\nSee [reasoning](/guides/reasoning) for details.",
            "minimum": 1024,
            "title": "Budget Tokens",
            "type": "integer"
          },
          "type": {
            "const": "enabled",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["budget_tokens", "type"],
        "title": "ThinkingConfigEnabled",
        "type": "object"
      },
      "AnthropicThinkingConfigDisabled": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "disabled",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "ThinkingConfigDisabled",
        "type": "object",
        "x-stainless-go-constant-constructor": true
      },
      "AnthropicThinkingConfigAdaptive": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "adaptive",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "ThinkingConfigAdaptive",
        "type": "object",
        "description": "**Not supported yet.**"
      },
      "AnthropicToolChoice": {
        "description": "How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.",
        "discriminator": {
          "mapping": {
            "any": "#/components/schemas/AnthropicToolChoiceAny",
            "auto": "#/components/schemas/AnthropicToolChoiceAuto",
            "none": "#/components/schemas/AnthropicToolChoiceNone",
            "tool": "#/components/schemas/AnthropicToolChoiceTool"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AnthropicToolChoiceAuto"
          },
          {
            "$ref": "#/components/schemas/AnthropicToolChoiceAny"
          },
          {
            "$ref": "#/components/schemas/AnthropicToolChoiceTool"
          },
          {
            "$ref": "#/components/schemas/AnthropicToolChoiceNone"
          }
        ],
        "title": "Tool Choice"
      },
      "AnthropicToolChoiceAuto": {
        "additionalProperties": false,
        "description": "The model will automatically decide whether to use tools.",
        "properties": {
          "disable_parallel_tool_use": {
            "description": "Whether to disable parallel tool use.\n\nDefaults to `false`. If set to `true`, the model will output at most one tool use.",
            "title": "Disable Parallel Tool Use",
            "type": "boolean"
          },
          "type": {
            "const": "auto",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "ToolChoiceAuto",
        "type": "object"
      },
      "AnthropicToolChoiceAny": {
        "additionalProperties": false,
        "description": "The model will use any available tools.",
        "properties": {
          "disable_parallel_tool_use": {
            "description": "Whether to disable parallel tool use.\n\nDefaults to `false`. If set to `true`, the model will output exactly one tool use.",
            "title": "Disable Parallel Tool Use",
            "type": "boolean"
          },
          "type": {
            "const": "any",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "ToolChoiceAny",
        "type": "object"
      },
      "AnthropicToolChoiceTool": {
        "additionalProperties": false,
        "description": "The model will use the specified tool with `tool_choice.name`.",
        "properties": {
          "disable_parallel_tool_use": {
            "description": "Whether to disable parallel tool use.\n\nDefaults to `false`. If set to `true`, the model will output exactly one tool use.",
            "title": "Disable Parallel Tool Use",
            "type": "boolean"
          },
          "name": {
            "description": "The name of the tool to use.",
            "title": "Name",
            "type": "string"
          },
          "type": {
            "const": "tool",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["name", "type"],
        "title": "ToolChoiceTool",
        "type": "object"
      },
      "AnthropicToolChoiceNone": {
        "additionalProperties": false,
        "description": "The model will not be allowed to use tools.",
        "properties": {
          "type": {
            "const": "none",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "ToolChoiceNone",
        "type": "object",
        "x-stainless-go-constant-constructor": true
      },
      "AnthropicTool": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "const": "custom",
                "type": "string"
              }
            ],
            "title": "Type"
          },
          "description": {
            "description": "Description of what this tool does.\n\nTool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.",
            "examples": ["Get the current weather in a given location"],
            "title": "Description",
            "type": "string"
          },
          "name": {
            "description": "Name of the tool.\n\nThis is how the tool will be called by the model and in `tool_use` blocks.",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]{1,128}$",
            "title": "Name",
            "type": "string"
          },
          "input_schema": {
            "$ref": "#/components/schemas/AnthropicInputSchema",
            "description": "[JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.\n\nThis defines the shape of the `input` that your tool accepts and that the model will produce.",
            "examples": [
              {
                "properties": {
                  "location": {
                    "description": "The city and state, e.g. San Francisco, CA",
                    "type": "string"
                  },
                  "unit": {
                    "description": "Unit for the output - one of (celsius, fahrenheit)",
                    "type": "string"
                  }
                },
                "required": ["location"],
                "type": "object"
              }
            ],
            "x-stainless-skip": ["cli"]
          },
          "strict": {
            "description": "When true, guarantees schema validation on tool names and inputs",
            "title": "Strict",
            "type": "boolean"
          }
        },
        "required": ["name", "input_schema"],
        "title": "Tool",
        "type": "object"
      },
      "AnthropicInputSchema": {
        "additionalProperties": true,
        "properties": {
          "properties": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Properties"
          },
          "required": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Required"
          },
          "type": {
            "const": "object",
            "title": "Type",
            "type": "string"
          }
        },
        "required": ["type"],
        "title": "InputSchema",
        "type": "object"
      },
      "AnthropicRawOutput": {
        "additionalProperties": false,
        "description": "Fireworks extension that returns low-level details of what the model sees, including the formatted prompt and function calls.",
        "properties": {
          "prompt_fragments": {
            "description": "Pieces of the prompt (like individual messages) before truncation and concatenation. Depending on prompt_truncate_len some of the messages might be dropped. Contains a mix of strings to be tokenized and individual tokens (if dictated by the conversation template)",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Prompt Fragments",
            "type": "array"
          },
          "prompt_token_ids": {
            "description": "Fully processed prompt as seen by the model",
            "items": {
              "type": "integer"
            },
            "title": "Prompt Token Ids",
            "type": "array"
          },
          "completion": {
            "description": "Raw completion produced by the model before any tool calls are parsed",
            "title": "Completion",
            "type": "string"
          },
          "completion_token_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Token IDs for the raw completion",
            "title": "Completion Token Ids"
          },
          "images": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Images in the prompt",
            "title": "Images"
          },
          "grammar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Grammar used for constrained decoding, can be either user provided (directly or JSON schema) or inferred by the chat template",
            "title": "Grammar"
          }
        },
        "required": ["prompt_fragments", "prompt_token_ids", "completion"],
        "title": "RawOutput",
        "type": "object"
      },
      "AnthropicMessageStartEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "message_start",
            "type": "string"
          },
          "message": {
            "$ref": "#/components/schemas/AnthropicMessage"
          }
        },
        "required": ["type", "message"]
      },
      "AnthropicContentBlockStartEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "content_block_start",
            "type": "string"
          },
          "index": {
            "type": "integer"
          },
          "content_block": {
            "$ref": "#/components/schemas/AnthropicContentBlock"
          }
        },
        "required": ["type", "index", "content_block"]
      },
      "AnthropicContentBlockDeltaEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "content_block_delta",
            "type": "string"
          },
          "index": {
            "type": "integer"
          },
          "delta": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["text_delta", "thinking_delta", "signature_delta", "input_json_delta", "citations_delta"]
              },
              "text": {
                "type": "string"
              },
              "thinking": {
                "type": "string"
              },
              "signature": {
                "type": "string"
              },
              "partial_json": {
                "type": "string"
              }
            },
            "required": ["type"]
          }
        },
        "required": ["type", "index", "delta"]
      },
      "AnthropicContentBlockStopEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "content_block_stop",
            "type": "string"
          },
          "index": {
            "type": "integer"
          }
        },
        "required": ["type", "index"]
      },
      "AnthropicMessageDeltaEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "message_delta",
            "type": "string"
          },
          "delta": {
            "type": "object",
            "properties": {
              "stop_reason": {
                "$ref": "#/components/schemas/AnthropicStopReason"
              },
              "stop_sequence": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "output_tokens": {
                "type": "integer"
              }
            },
            "required": ["output_tokens"]
          }
        },
        "required": ["type", "delta", "usage"]
      },
      "AnthropicMessageStopEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "message_stop",
            "type": "string"
          }
        },
        "required": ["type"]
      },
      "AnthropicPingEvent": {
        "type": "object",
        "properties": {
          "type": {
            "const": "ping",
            "type": "string"
          }
        },
        "required": ["type"]
      },
      "AnthropicMessageStreamEvent": {
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "message_start": "#/components/schemas/AnthropicMessageStartEvent",
            "content_block_start": "#/components/schemas/AnthropicContentBlockStartEvent",
            "content_block_delta": "#/components/schemas/AnthropicContentBlockDeltaEvent",
            "content_block_stop": "#/components/schemas/AnthropicContentBlockStopEvent",
            "message_delta": "#/components/schemas/AnthropicMessageDeltaEvent",
            "message_stop": "#/components/schemas/AnthropicMessageStopEvent",
            "ping": "#/components/schemas/AnthropicPingEvent"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/AnthropicMessageStartEvent"
          },
          {
            "$ref": "#/components/schemas/AnthropicContentBlockStartEvent"
          },
          {
            "$ref": "#/components/schemas/AnthropicContentBlockDeltaEvent"
          },
          {
            "$ref": "#/components/schemas/AnthropicContentBlockStopEvent"
          },
          {
            "$ref": "#/components/schemas/AnthropicMessageDeltaEvent"
          },
          {
            "$ref": "#/components/schemas/AnthropicMessageStopEvent"
          },
          {
            "$ref": "#/components/schemas/AnthropicPingEvent"
          }
        ],
        "description": "A Server-Sent Event from the Messages API stream."
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer authentication using your Fireworks API key. Format: Bearer <API_KEY>",
        "bearerFormat": "API_KEY"
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ]
}
