BerriAI/litellm · error · NotImplementedError

Batch creation not yet implemented for Anthropic

Error message

Batch creation not yet implemented for Anthropic

What it means

Feature-support guard: transform_create_batch_request is invoked but batch creation for Anthropic is not implemented in this LiteLLM version; only retrieval is supported, so the operation is explicitly rejected.

Solutions

  1. Do not call create_batch with the anthropic provider; Anthropic batch creation is not supported in this version.
  2. Use a provider that implements batch creation, or upgrade litellm if support has been added.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/llms/anthropic/batches/transformation.py:92 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/dca2fca51e2b1ab1. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/anthropic/batches/transformation.py:92

        """Get the complete URL for batch creation request."""
        api_base = api_base or self.anthropic_model_info.get_api_base(api_base)
        if not api_base.endswith("/v1/messages/batches"):
            api_base = f"{api_base.rstrip('/')}/v1/messages/batches"
        return api_base

    def transform_create_batch_request(
        self,
        model: str,
        create_batch_data: CreateBatchRequest,
        optional_params: dict,
        litellm_params: dict,
    ) -> bytes | str | dict[str, Any]:
        """
        Transform the batch creation request to Anthropic format.

        Not currently implemented - placeholder to satisfy abstract base class.
        """
        raise NotImplementedError("Batch creation not yet implemented for Anthropic")

    def transform_create_batch_response(
        self,
        model: str | None,
        raw_response: httpx.Response,
        logging_obj: LoggingClass,
        litellm_params: dict,
    ) -> LiteLLMBatch:
        """
        Transform Anthropic MessageBatch creation response to LiteLLM format.

        Not currently implemented - placeholder to satisfy abstract base class.
        """
        raise NotImplementedError("Batch creation not yet implemented for Anthropic")

    def get_retrieve_batch_url(
        self,
        api_base: str | None,

View on GitHub (pinned to 77b7c6c40c)