---
title: "Get Message (v2 - UIMessage format)"
method: GET
path: "/v2/messages/{message_id}"
tags: ["Messages v2"]
---

# Get Message (v2 - UIMessage format)

`GET /v2/messages/{message_id}`

Get a single message by ID in UIMessage format.

    Returns the transformed UIMessage or null if not found.

## Path parameters

- `message_id` string, required

## Query parameters

- `task_id` string, required — The task ID

## Response `200`

Successful Response

- UIMessage — Vercel AI SDK compatible message format. Based on: https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message with extensions for our use case.
  - `createdAt` string, nullable — ISO timestamp when created
  - `id` string, required — Unique message ID
  - `metadata` UIMessageMetadata — Metadata for a UIMessage.
    - `costUsd` number, nullable — Cost in USD for this message
    - `durationMs` integer, nullable — Duration in milliseconds
    - `model` string, nullable — Model used to generate message
    - `parentToolUseId` string, nullable — Parent tool use ID for subagent context
    - `usage` Usage — Token usage statistics.
      - `inputTokens` integer, required — Input tokens used
      - `outputTokens` integer, required — Output tokens used
      - `totalTokens` integer, nullable — Total tokens (input + output)
  - `parts` UIMessagePartWrapper[], required — Content parts of the message
    - union — Wrapper for UIMessagePart union for proper serialization.
      - TextPart — Text content part.
        - `text` string, required — The text content
        - `type` 'text' — Part type discriminator
      - ReasoningPart — Reasoning/thinking content part (Claude's extended thinking).
        - `providerMetadata` object, nullable — Provider-specific metadata (e.g., Claude's thinking.signature)
        - `text` string, required — The reasoning text content
        - `type` 'reasoning' — Part type discriminator
      - ToolPart — Tool invocation and result part.
        - `errorText` string, nullable — Error message if tool failed
        - `input` object, required — Input arguments for the tool
        - `output` unknown
        - `state` 'input-streaming' | 'input-available' | 'output-available' | 'output-error', required — State of a tool part.
        - `toolCallId` string, required — Unique ID for this tool call
        - `toolName` string, required — Name of the tool
        - `type` 'tool' — Part type discriminator
      - SourceUrlPart — Source URL reference part.
        - `sourceId` string, required — Unique source ID
        - `title` string, nullable — Title of the source
        - `type` 'source-url' — Part type discriminator
        - `url` string, required — URL of the source
      - FilePart — File attachment part.
        - `mediaType` string, required — MIME type of the file
        - `type` 'file' — Part type discriminator
        - `url` string, required — URL to the file
      - DataPart — Generic data part for unknown/passthrough content.
        - `data` unknown, required
        - `type` 'data' — Part type discriminator
      - ErrorPart — Error part for transformation failures.
        - `error` string, required — Error message
        - `rawContent` unknown
        - `type` 'error' — Part type discriminator
  - `role` 'system' | 'user' | 'assistant', required — Role of the message author.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/revisions/f24a474dc415/schema)
