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.

Function python AnthropicClient SyncAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  67bbe556_2c2b_af81_4b28_d25dd002fec9["create()"]
  2a025d5d_3057_7bf3_fea3_d693a30b85ec["Batches"]
  67bbe556_2c2b_af81_4b28_d25dd002fec9 -->|defined in| 2a025d5d_3057_7bf3_fea3_d693a30b85ec
  b54deab4_98e8_9cde_eb32_5233f50cb95b["create()"]
  b54deab4_98e8_9cde_eb32_5233f50cb95b -->|calls| 67bbe556_2c2b_af81_4b28_d25dd002fec9
  b54deab4_98e8_9cde_eb32_5233f50cb95b["create()"]
  67bbe556_2c2b_af81_4b28_d25dd002fec9 -->|calls| b54deab4_98e8_9cde_eb32_5233f50cb95b
  style 67bbe556_2c2b_af81_4b28_d25dd002fec9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/messages/batches.py lines 47–87

    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 self._post(
            "/v1/messages/batches",
            body=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 47.
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