Home / Function/ create() — anthropic-sdk-python Function Reference

create() — anthropic-sdk-python Function Reference

Architecture documentation for the create() function in batches.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  afc57942_a9fa_10d8_c3dd_dd47823ce547["create()"]
  be977544_dc77_a5d8_fd28_356b9a4e2e59["AsyncBatches"]
  afc57942_a9fa_10d8_c3dd_dd47823ce547 -->|defined in| be977544_dc77_a5d8_fd28_356b9a4e2e59
  654d5432_9901_16ca_f9a4_cff08a407d06["create()"]
  654d5432_9901_16ca_f9a4_cff08a407d06 -->|calls| afc57942_a9fa_10d8_c3dd_dd47823ce547
  654d5432_9901_16ca_f9a4_cff08a407d06["create()"]
  afc57942_a9fa_10d8_c3dd_dd47823ce547 -->|calls| 654d5432_9901_16ca_f9a4_cff08a407d06
  style afc57942_a9fa_10d8_c3dd_dd47823ce547 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/messages/batches.py lines 350–390

    async def create(
        self,
        *,
        requests: Iterable[batch_create_params.Request],
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> MessageBatch:
        """
        Send a batch of Message creation requests.

        The Message Batches API can be used to process multiple Messages API requests at
        once. Once a Message Batch is created, it begins processing immediately. Batches
        can take up to 24 hours to complete.

        Learn more about the Message Batches API in our
        [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

        Args:
          requests: List of requests for prompt completion. Each is an individual request to create
              a Message.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._post(
            "/v1/messages/batches",
            body=await async_maybe_transform({"requests": requests}, batch_create_params.BatchCreateParams),
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=MessageBatch,
        )

Subdomains

Calls

Called By

Frequently Asked Questions

What does create() do?
create() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/resources/messages/batches.py.
Where is create() defined?
create() is defined in src/anthropic/resources/messages/batches.py at line 350.
What does create() call?
create() calls 1 function(s): create.
What calls create()?
create() is called by 1 function(s): create.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free