apache-airflow-providers-anthropic¶
The anthropic provider gives Dags direct access to Anthropic’s own APIs — this page
compares that choice against common.ai.
When to use this provider¶
Use anthropic when a Dag needs Anthropic’s native API surface — services Anthropic runs
for you, which no vendor-neutral operator wraps:
AnthropicBatchOperatorandAnthropicBatchSensor— submit a Claude Message Batches job for asynchronous bulk processing and wait for it to complete; Message Batches run at 50% of standard cost, with most completing within an hour and a 24-hour SLA.AnthropicAgentSessionOperator— start a Managed Agents session in which the agent loop runs server-side on Anthropic’s infrastructure; the Airflow task only kicks off the session and waits for its outcome.
Use apache-airflow-providers-common-ai instead when the AI step should be run by Airflow itself and stay vendor-neutral:
Generation, classification, or structured extraction with
LLMOperator— it works with Claude via a connection, and switching to another model provider later is a connection change, not a Dag rewrite.Agents whose loop runs in the Airflow worker with
AgentOperator— Airflow-defined toolsets (SQL, hooks, MCP servers), human-in-the-loop review, and durable step replay.
Both AgentOperator and AnthropicAgentSessionOperator run agents with Claude models;
the difference is where the loop executes and who controls the tools. AgentOperator
orchestrates the loop in the worker and calls tools you define in the Dag.
AnthropicAgentSessionOperator hands the whole session to Anthropic’s managed service —
the agent runs autonomously against a pre-created agent and environment, without
Airflow-side tool execution.
For example, running the Message Batches API directly:
from airflow.providers.anthropic.operators.batch import AnthropicBatchOperator
run_batch = AnthropicBatchOperator(
task_id="run_batch",
conn_id=ANTHROPIC_CONN_ID,
requests=requests,
deferrable=True,
)
apache-airflow-providers-anthropic package¶
Anthropic provider for Apache Airflow. Wraps the official Anthropic Python SDK to run the Claude Message Batches API asynchronously from Airflow, plus direct message and token-counting helpers.
Release: 0.2.0
Provider package¶
This package is for the anthropic provider.
All classes for this package are included in the airflow.providers.anthropic python package.
Installation¶
You can install this package on top of an existing Airflow installation via
pip install apache-airflow-providers-anthropic.
For the minimum Airflow version supported, see Requirements below.
Requirements¶
The minimum Apache Airflow version supported by this provider distribution is 3.0.0.
PIP package |
Version required |
|---|---|
|
|
|
|
|
|
Optional dependencies¶
These extras install optional third-party libraries that enable additional features of the provider. Install them when installing from PyPI. For example:
pip install apache-airflow-providers-anthropic[bedrock]
Extra |
Dependencies |
|---|---|
|
|
|
|
|
|
Downloading official packages¶
You can download officially released packages and verify their checksums and signatures from the Official Apache Download site