Expand description
Anthropic Messages API protocol definitions
This module provides Rust types for the Anthropic Messages API. See: https://docs.anthropic.com/en/api/messages
Structs§
- Bash
Code Execution Output Block - Bash code execution output file reference
- Bash
Code Execution Result Block - Bash code execution result block (beta)
- Bash
Code Execution Tool Result Block - Bash code execution tool result block (beta)
- Bash
Code Execution Tool Result Error - Bash code execution tool result error
- Bash
Tool - Bash tool for computer use
- Cache
Creation - Cache creation breakdown
- Char
Location Citation - Character location citation
- Citations
Config - Citations configuration
- Code
Execution Output Block - Code execution output file reference
- Code
Execution Result Block - Code execution result block (beta)
- Code
Execution Tool - Code execution tool (beta)
- Code
Execution Tool Result Block - Code execution tool result block (beta)
- Code
Execution Tool Result Error - Code execution tool result error
- Computer
UseTool - Computer use tool (beta)
- Container
Config - Container configuration for code execution (beta)
- Container
Upload Block - Container upload block (beta)
- Content
Block Location Citation - Content block location citation
- Count
Message Tokens Request - Request to count tokens in a message
- Count
Message Tokens Response - Response from token counting
- Create
Message Request - Request to create a message using the Anthropic Messages API.
- Custom
Tool - Custom tool definition
- Document
Block - Document content block
- Error
Response - Error response
- Image
Block - Image content block
- Input
Message - A single input message in a conversation
- Input
Schema - JSON Schema for tool input
- List
Models Response - List of models response
- McpServer
Config - MCP server configuration (beta)
- McpTool
Config - Per-tool MCP configuration
- McpTool
Configuration - MCP tool configuration
- McpTool
Default Config - Default configuration for MCP tools
- McpTool
Result Block - MCP tool result block (beta) - for user messages
- McpTool
UseBlock - MCP tool use block (beta) - for assistant messages
- McpToolset
- MCP toolset definition (beta)
- Memory
Tool - Memory tool (beta)
- Message
- Response message from the API
- Message
Delta - Message delta for streaming updates
- Message
Delta Usage - Usage delta for streaming updates
- Metadata
- Request metadata
- Model
Info - Model information
- Page
Location Citation - Page location citation
- Redacted
Thinking Block - Redacted thinking block
- Search
Result Block - Search result block
- Search
Result Location Citation - Search result location citation
- Server
Tool Usage - Server tool usage information
- Server
Tool UseBlock - Server tool use block
- Text
Block - Text content block
- Text
Editor Code Execution Create Result Block - Text editor create result block
- Text
Editor Code Execution StrReplace Result Block - Text editor str_replace result block
- Text
Editor Code Execution Tool Result Block - Text editor code execution tool result block (beta)
- Text
Editor Code Execution Tool Result Error - Text editor code execution tool result error
- Text
Editor Code Execution View Result Block - Text editor view result block
- Text
Editor Tool - Text editor tool for computer use
- Thinking
Block - Thinking block
- Tool
Reference Block - Tool reference block (beta) - returned by tool search
- Tool
Result Block - Tool result block (in user messages)
- Tool
Search Result Block - Tool search result block (beta)
- Tool
Search Tool - Tool search tool (beta)
- Tool
Search Tool Result Block - Tool search tool result block (beta)
- Tool
UseBlock - Tool use block (in assistant messages)
- Usage
- Billing and rate-limit usage
- User
Location - User location for web search
- WebFetch
Result Block - Web fetch result block (beta)
- WebFetch
Tool - Web fetch tool (beta)
- WebFetch
Tool Result Block - Web fetch tool result block (beta)
- WebFetch
Tool Result Error - Web fetch tool result error
- WebSearch
Result Block - Web search result block
- WebSearch
Result Location Citation - Web search result location citation
- WebSearch
Tool - Web search tool
- WebSearch
Tool Result Block - Web search tool result block
- WebSearch
Tool Result Error - Web search tool result error
Enums§
- ApiError
- API error types
- Bash
Code Execution Tool Result Content - Bash code execution tool result content
- Bash
Code Execution Tool Result Error Code - Bash code execution error codes
- Beta
Content Block - Beta output content block types (extends ContentBlock)
- Beta
Input Content Block - Beta input content block types (extends InputContentBlock)
- Beta
Server Tool Name - Server tool names for beta features
- Beta
Tool - Beta tool definition (extends Tool)
- Cache
Control - Cache control configuration
- Citation
- Citation types
- Code
Execution Tool Result Content - Code execution tool result content
- Code
Execution Tool Result Error Code - Code execution error codes
- Content
Block - Output content block types
- Content
Block Delta - Content block delta for streaming updates
- Document
Source - Document source (base64, text, or URL)
- Image
Source - Image source (base64 or URL)
- Input
Content - Input content can be a string or an array of content blocks
- Input
Content Block - Input content block types
- Message
Stream Event - Server-sent event wrapper
- Role
- Role of a message sender
- Server
Tool Caller - Server tool caller types (beta)
- Service
Tier - Service tier options
- Stop
Reason - Stop reasons
- System
Content - System content can be a string or an array of text blocks
- Text
Editor Code Execution Tool Result Content - Text editor code execution result content
- Text
Editor Code Execution Tool Result Error Code - Text editor code execution error codes
- Thinking
Config - Configuration for extended thinking
- Tool
- Tool definition
- Tool
Choice - How the model should use the provided tools
- Tool
Result Content - Tool result content (string or blocks)
- Tool
Result Content Block - Content blocks allowed in tool results
- WebFetch
Tool Result Content - Web fetch tool result content
- WebFetch
Tool Result Error Code - Web fetch error codes
- WebSearch
Tool Result Content - Web search tool result content
- WebSearch
Tool Result Error Code - Web search tool result error codes