Message
Reference for the Message schema.
export type = {
// required
:
: string
: string
: number
: string
// optional
?: string
?: string
?: number
}Sources
Each source's record of one message in a conversation. Claude Code keeps its own as lines of a transcript file whose format it calls internal, and Vercel eve keeps no public record of one.
Anomaly OpenCode
https://opencode.ai/v2/docs/api
type = {
: string & <"Session.Message.ID">
?: { readonly [: string]: unknown }
:
| { readonly : Utc }
| {
readonly : Utc
readonly ?: Utc | undefined
readonly ?: Utc | undefined
}
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc; readonly ?: Utc | undefined }
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc }
| { readonly : Utc }
:
| "agent-switched"
| "assistant"
| "compaction"
| "idle"
| "location-switched"
| "model-switched"
| "shell"
| "skill"
| "synthetic"
| "system"
| "user"
}Claude Agent SDK
https://code.claude.com/docs/en/agent-sdk/session-storage#the-sessionstore-interface
type = {
?: string
: string
?: string
}Cloudflare Agents
https://developers.cloudflare.com/agents/
type = {
?:
: string
?: unknown
: SessionMessagePart[]
: string
}Mastra
https://mastra.ai/docs/memory/overview
type = {
: MastraMessageContentV2
:
: string
?: string
: "assistant" | "signal" | "system" | "user"
?: string
?: string
}OpenAI Agents SDK
https://openai.github.io/openai-agents-js/guides/sessions/
type = {
?: string
?: <string, any>
?:
| "apply_patch_call"
| "apply_patch_call_output"
| "compaction"
| "computer_call"
| "computer_call_result"
| "function_call"
| "function_call_result"
| "hosted_tool_call"
| "message"
| "program"
| "program_output"
| "reasoning"
| "shell_call"
| "shell_call_output"
| "tool_search_call"
| "tool_search_output"
| "unknown"
}OpenAI Codex
https://learn.chatgpt.com/docs/app-server#threads
type = {
: number | null
: ThreadItem
: number | null
: string
}Vercel AI SDK
https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence
type = {
: string
?: unknown
: <UIDataTypes, UITools>[]
: "assistant" | "system" | "user"
}