Response Formats
This reference provides detailed information about the structure and content of API responses across all endpoints.Common Response Fields
All successful responses include these standard fields:Reason for response completion. Possible values:
"stop": Normal completion"length": Response truncated due to length limits"tool_calls": Response ended due to tool usage
Generate Endpoint Response
Complete Response Structure
Step Object Structure
Streaming Response Events
Event Types
Tool Call Event Format
Tool Result Event Format
Speech-to-Text Response
Memory Management Response
Thread Creation Response
Error Response Format
Common Error Codes
Data Types Reference
Message Format
Tool Call Format
Tool Result Format
Response Size Considerations
Response Size Limits: Large responses may be truncated. Use streaming for long conversations.
Tool Results: Complex tool results are included in full, monitor response sizes.
Token Usage: Track usage statistics to manage costs and rate limits.
