Claude Platform Docs

메시지

메시지 생성
POST/v1/messages

텍스트 및/또는 이미지 콘텐츠가 포함된 구조화된 입력 메시지 목록을 전송하면 모델이 대화의 다음 메시지를 생성합니다.

메시지의 토큰 수 계산
POST/v1/messages/count_tokens

메시지의 토큰 수를 계산합니다.

Models
BetaAdvisorMessageIterationUsage object{ type, cache_creation, cache_creation_input_tokens, 4 more }

Token usage for an advisor sub-inference iteration.

BetaAdvisorRedactedResultBlock object{ type, encrypted_content, stop_reason }
type: "advisor_redacted_result"
defaultadvisor_redacted_result
encrypted_content: string

Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.

stop_reason: string or null

The advisor sub-inference's stop reason (same values as the top-level message stop_reason).

BetaAdvisorRedactedResultBlockParam object{ type, encrypted_content, stop_reason }
type: "advisor_redacted_result"
encrypted_content: string

Opaque blob produced by a prior response; must be round-tripped verbatim.

stop_reason: optional string or null
BetaAdvisorResultBlock object{ type, stop_reason, text }
type: "advisor_result"
defaultadvisor_result
stop_reason: string or null

The advisor sub-inference's stop reason (same values as the top-level message stop_reason). max_tokens indicates the advisor's output was truncated at the tool's max_tokens value or the advisor model's policy cap.

text: string
BetaAdvisorResultBlockParam object{ type, text, stop_reason }
type: "advisor_result"
text: string
stop_reason: optional string or null
BetaAdvisorTool20260301 object{ type, model, name, 7 more }
BetaAdvisorToolResultBlock object{ type, content, tool_use_id }
BetaAdvisorToolResultBlockParam object{ type, content, tool_use_id, cache_control }
BetaAdvisorToolResultError object{ type, error_code }
type: "advisor_tool_result_error"
defaultadvisor_tool_result_error
error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more
One of the following:
"max_uses_exceeded"
"prompt_too_long"
"too_many_requests"
"overloaded"
"unavailable"
"execution_time_exceeded"
"model_not_found"
BetaAdvisorToolResultErrorParam object{ type, error_code }
type: "advisor_tool_result_error"
error_code: "max_uses_exceeded" or "prompt_too_long" or "too_many_requests" or 4 more
One of the following:
"max_uses_exceeded"
"prompt_too_long"
"too_many_requests"
"overloaded"
"unavailable"
"execution_time_exceeded"
"model_not_found"
BetaAllThinkingTurns object{ type }
type: "all"
BetaBase64ImageSource object{ type, data, media_type }
type: "base64"
data: string
formatbyte
media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
One of the following:
"image/jpeg"
"image/png"
"image/gif"
"image/webp"
BetaBase64PDFSource object{ type, data, media_type }
type: "base64"
data: string
formatbyte
media_type: "application/pdf"
BetaBashCodeExecutionOutputBlock object{ type, file_id }
type: "bash_code_execution_output"
defaultbash_code_execution_output
file_id: string
BetaBashCodeExecutionOutputBlockParam object{ type, file_id }
type: "bash_code_execution_output"
file_id: string
BetaBashCodeExecutionResultBlock object{ type, content, return_code, 2 more }
type: "bash_code_execution_result"
defaultbash_code_execution_result
content: array of BetaBashCodeExecutionOutputBlock { type, file_id }
type: "bash_code_execution_output"
defaultbash_code_execution_output
file_id: string
return_code: number
stderr: string
stdout: string
BetaBashCodeExecutionResultBlockParam object{ type, content, return_code, 2 more }
type: "bash_code_execution_result"
content: array of BetaBashCodeExecutionOutputBlockParam { type, file_id }
type: "bash_code_execution_output"
file_id: string
return_code: number
stderr: string
stdout: string
BetaBashCodeExecutionToolResultBlock object{ type, content, tool_use_id }
BetaBashCodeExecutionToolResultBlockParam object{ type, content, tool_use_id, cache_control }
BetaBashCodeExecutionToolResultError object{ type, error_code }
type: "bash_code_execution_tool_result_error"
defaultbash_code_execution_tool_result_error
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
BetaBashCodeExecutionToolResultErrorParam object{ type, error_code }
type: "bash_code_execution_tool_result_error"
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
BetaBrowserCloseTabConfig object{ defer_loading, enabled }

close_tab's config overrides.

defer_loading: optional boolean or null

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean or null

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

BetaBrowserDoubleClickConfig object{ defer_loading, enabled }

double_click's config overrides.

defer_loading: optional boolean or null

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean or null

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

BetaBrowserFileUploadConfig object{ defer_loading, enabled }

file_upload's config overrides.

defer_loading: optional boolean or null

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean or null

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

BetaBrowserFindConfig object{ defer_loading, enabled }

find's config overrides.

defer_loading: optional boolean or null

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean or null

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

BetaBrowserFormInputConfig object{ defer_loading, enabled }

form_input's config overrides.

defer_loading: optional boolean or null

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean or null

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

BetaBrowserGetPageTextConfig object{ defer_loading, enabled }

get_page_text's config overrides.

defer_loading: optional boolean or null

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean or null

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

BetaBrowserHoldKeyConfig object{ defer_loading, enabled }

hold_key's config overrides.

defer_loading: optional boolean or null