Skip to content

docs: document 64-character limit for batch custom_id#1220

Open
nielskaspers wants to merge 1 commit intoanthropics:mainfrom
nielskaspers:fix/984-batch-custom-id-char-limit-docs
Open

docs: document 64-character limit for batch custom_id#1220
nielskaspers wants to merge 1 commit intoanthropics:mainfrom
nielskaspers:fix/984-batch-custom-id-char-limit-docs

Conversation

@nielskaspers
Copy link

Summary

Fixes #984

The API enforces a maximum length of 64 characters for the custom_id field in Message Batch requests, but this constraint was not documented anywhere in the SDK type definitions. Sending a longer custom_id returns a cryptic 400 error:

BadRequestError: requests.0.custom_id: String should have at most 64 characters

Changes

Added Must be 64 characters or fewer. to the custom_id docstring in:

  • src/anthropic/types/messages/batch_create_params.py (GA)
  • src/anthropic/types/beta/messages/batch_create_params.py (beta)

Test plan

  • Confirm the docstring appears in IDE hover/autocomplete for Request.custom_id

The API returns a 400 error if custom_id exceeds 64 characters but this
constraint was not documented in the type definitions. Add the limit to
the docstring in both the GA and beta batch_create_params modules.

Fixes anthropics#984
@nielskaspers nielskaspers requested a review from a team as a code owner March 4, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Message Batch Processing - undocumented character limit for custom_id parameter

1 participant