Liking cljdoc? Tell your friends :D

Messages API spec checklist

Generated by bb spec:checklist from spec/upstream/ and spec/implemented.edn. Do not edit by hand.

Implemented: 181 of 181.

API version

Implemented means: The default anthropic-version header is this version.

  • [x] 2026-10-21

Endpoints

Implemented means: A public function calls the endpoint.

  • [x] POST /v1/messages (Create a Message)
  • [x] POST /v1/messages/count_tokens (Count tokens in a Message)
  • [x] POST /v1/messages/batches (Create a Message Batch)
  • [x] GET /v1/messages/batches/{message_batch_id} (Retrieve a Message Batch)
  • [x] GET /v1/messages/batches (List Message Batches)
  • [x] POST /v1/messages/batches/{message_batch_id}/cancel (Cancel a Message Batch)
  • [x] DELETE /v1/messages/batches/{message_batch_id} (Delete a Message Batch)
  • [x] GET /v1/messages/batches/{message_batch_id}/results (Retrieve Message Batch results)

Request headers

Implemented means: The client can send the header.

  • [x] anthropic-version: optional string
  • [x] anthropic-user-profile-id: optional string
  • [x] anthropic-workspace-id: optional string

Create a Message: body parameters

Implemented means: A value of the parameter's type reaches the wire unchanged.

  • [x] max_tokens: number
  • [x] messages: array of MessageParam
  • [x] model: Model
  • [x] cache_control: optional CacheControlEphemeral or null
  • [x] container: optional MessageCreateParamsContainer or null
  • [x] diagnostics: optional DiagnosticsParam or null
  • [x] inference_geo: optional string or null
  • [x] metadata: optional Metadata
  • [x] output_config: optional OutputConfig
  • [x] service_tier: optional "auto" or "standard_only"
  • [x] speed: optional "standard" or "fast" or null
  • [x] stop_sequences: optional array of string
  • [x] stream: optional boolean
  • [x] system: optional string or array of TextBlockParam
  • [x] thinking: optional ThinkingConfigParam
  • [x] tool_choice: optional ToolChoice
  • [x] tools: optional array of ToolUnion

Count tokens: body parameters

Implemented means: A value of the parameter's type reaches the wire unchanged.

  • [x] messages: array of MessageParam
  • [x] model: Model
  • [x] cache_control: optional CacheControlEphemeral or null
  • [x] output_config: optional OutputConfig
  • [x] speed: optional "standard" or "fast" or null
  • [x] system: optional string or array of TextBlockParam
  • [x] thinking: optional ThinkingConfigParam
  • [x] tool_choice: optional ToolChoice
  • [x] tools: optional array of MessageCountTokensTool

Request content blocks

Implemented means: A block of this type reaches the wire unchanged.

  • [x] text
  • [x] image
  • [x] document
  • [x] search_result
  • [x] thinking
  • [x] redacted_thinking
  • [x] tool_use
  • [x] tool_result
  • [x] server_tool_use
  • [x] web_search_tool_result
  • [x] web_fetch_tool_result
  • [x] code_execution_tool_result
  • [x] bash_code_execution_tool_result
  • [x] text_editor_code_execution_tool_result
  • [x] tool_search_tool_result
  • [x] container_upload

Tool definitions

Implemented means: A tool of this type reaches the wire unchanged.

  • [x] custom
  • [x] bash_20250124
  • [x] code_execution_20250522
  • [x] code_execution_20250825
  • [x] code_execution_20260120
  • [x] code_execution_20260521
  • [x] browser_toolset_20260801
  • [x] memory_20250818
  • [x] computer_toolset_20260801
  • [x] text_editor_20250124
  • [x] text_editor_20250429
  • [x] text_editor_20250728
  • [x] web_search_20250305
  • [x] web_fetch_20250910
  • [x] web_search_20260209
  • [x] web_fetch_20260209
  • [x] web_fetch_20260309
  • [x] web_search_20260318
  • [x] web_fetch_20260318
  • [x] tool_search_tool_bm25_20251119
  • [x] tool_search_tool_regex_20251119

Count tokens: response fields

Implemented means: The field is returned unchanged.

  • [x] input_tokens: number

Response: Message fields

Implemented means: The field is returned unchanged, and assembled correctly from a stream.

  • [x] type: "message"
  • [x] id: string
  • [x] container: Container or null
  • [x] content: array of ContentBlock
  • [x] diagnostics: Diagnostics or null
  • [x] model: Model
  • [x] role: "assistant"
  • [x] stop_details: RefusalStopDetails or null
  • [x] stop_reason: StopReason or null
  • [x] stop_sequence: string or null
  • [x] usage: Usage

Response content blocks

Implemented means: The block is returned unchanged, and assembled correctly from a stream.

  • [x] text
  • [x] thinking
  • [x] redacted_thinking
  • [x] tool_use
  • [x] server_tool_use
  • [x] web_search_tool_result
  • [x] web_fetch_tool_result
  • [x] code_execution_tool_result
  • [x] bash_code_execution_tool_result
  • [x] text_editor_code_execution_tool_result
  • [x] tool_search_tool_result
  • [x] container_upload

Stop reasons

Implemented means: The value is returned unchanged from both create and a stream.

  • [x] end_turn
  • [x] max_tokens
  • [x] stop_sequence
  • [x] tool_use
  • [x] pause_turn
  • [x] refusal
  • [x] model_context_window_exceeded

Stream events

Implemented means: The event is parsed and folded into the final message.

  • [x] message_start
  • [x] message_delta
  • [x] message_stop
  • [x] content_block_start
  • [x] content_block_delta
  • [x] content_block_stop
  • [x] ping
  • [x] error

Stream content block deltas

Implemented means: The delta is folded into its content block.

  • [x] text_delta
  • [x] input_json_delta
  • [x] citations_delta
  • [x] thinking_delta
  • [x] signature_delta

Message Batches: create body parameters

Implemented means: A value of the parameter's type reaches the wire unchanged.

  • [x] requests: array of object

Message Batches: list query parameters

Implemented means: The parameter is sent in the query string.

  • [x] after_id: optional string
  • [x] before_id: optional string
  • [x] limit: optional number

Message Batches: batch fields

Implemented means: The field is returned unchanged by every function that returns a batch.

  • [x] type: "message_batch"
  • [x] id: string
  • [x] archived_at: string or null
  • [x] cancel_initiated_at: string or null
  • [x] created_at: string
  • [x] ended_at: string or null
  • [x] expires_at: string
  • [x] processing_status: "in_progress" or "canceling" or "ended"
  • [x] request_counts: MessageBatchRequestCounts
  • [x] results_url: string or null

Message Batches: list response fields

Implemented means: The field is returned unchanged.

  • [x] data: array of MessageBatch
  • [x] first_id: string or null
  • [x] has_more: boolean
  • [x] last_id: string or null

Message Batches: result types

Implemented means: A result of this type is read from the results stream unchanged.

  • [x] succeeded
  • [x] errored
  • [x] canceled
  • [x] expired

Error types

Implemented means: The error becomes an ex-info with the documented :type.

  • [x] invalid_request_error (HTTP 400)
  • [x] authentication_error (HTTP 401)
  • [x] billing_error (HTTP 402)
  • [x] permission_error (HTTP 403)
  • [x] not_found_error (HTTP 404)
  • [x] conflict_error (HTTP 409)
  • [x] request_too_large (HTTP 413)
  • [x] rate_limit_error (HTTP 429)
  • [x] api_error (HTTP 500)
  • [x] timeout_error (HTTP 504)
  • [x] overloaded_error (HTTP 529)

Error codes (error.details.error_code)

Implemented means: The code is exposed in the ex-info data.

  • [x] available_tools_limit_exceeded (HTTP 400)
  • [x] claude_code_key_creator_not_member (HTTP 400)
  • [x] claude_code_version_too_old (HTTP 400)
  • [x] cmek_key_disabled (HTTP 400)
  • [x] cmek_key_network_blocked (HTTP 400)
  • [x] compaction_block_ambiguous (HTTP 400)
  • [x] compaction_block_misplaced (HTTP 400)
  • [x] compaction_content_mismatch (HTTP 400)
  • [x] compaction_incomplete_turn (HTTP 400)
  • [x] compaction_nothing_to_summarize (HTTP 400)
  • [x] compaction_signature_invalid (HTTP 400)
  • [x] compaction_too_many_tool_references (HTTP 400)
  • [x] compaction_tool_changes_mismatch (HTTP 400)
  • [x] organization_on_hold (HTTP 400)
  • [x] request_body_encoding_invalid (HTTP 400)
  • [x] request_body_encoding_unsupported (HTTP 400)
  • [x] thread_already_continued (HTTP 400)
  • [x] thread_continue_in_flight (HTTP 400)
  • [x] thread_fingerprint_mismatch (HTTP 400)
  • [x] thread_unsupported_request (HTTP 400)
  • [x] tool_name_conflict (HTTP 400)
  • [x] tool_reference_unresolved (HTTP 400)
  • [x] thread_not_found (HTTP 404)
  • [x] skill_read_blocked_undecryptable (HTTP 409)
  • [x] request_body_too_large_after_decoding (HTTP 413)
  • [x] enforced_spend_limit_reached (HTTP 429)
  • [x] ramp_limit_exceeded (HTTP 429)
  • [x] cmek_key_unreachable (HTTP 503)
  • [x] compaction_unavailable (HTTP 529)

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close