Strands Agents
Strands Agents gets a governed OpenAIModel pointed at the Agent Fabric LLM
proxy. The connection details travel in Strands’ client_args, which Strands
passes straight through to its underlying OpenAI client.
What you get
- A native
strands.models.openai.OpenAIModel. - Full header and transport injection through
client_args— per-run correlation IDs anddonkey.last_callwork, as with LangGraph. - Supported at
connection_kwargs().
Install
pip install "donkey-kit[strands]"Quickstart
Python
from donkey_kit.integrations.strands import model
llm = model("gpt-4o")llm is a real strands.models.openai.OpenAIModel instance — pass it to your
Agent as you would any other Strands model.
Three ways to construct
1. Off a shared Donkey instance:
from donkey_kit import Donkey
async with Donkey.from_env() as donkey:
llm = donkey.strands.model("gpt-4o")2. Module-level factory (shortest):
from donkey_kit.integrations.strands import model
llm = model("gpt-4o")3. Governed kwargs, native constructor:
from donkey_kit import Donkey
from strands.models.openai import OpenAIModel
async with Donkey.from_env() as donkey:
llm = OpenAIModel(model_id="gpt-4o", **donkey.strands.connection_kwargs())Manual equivalent
from strands.models.openai import OpenAIModel
llm = OpenAIModel(
model_id="gpt-4o",
client_args={
"base_url": ..., # from DONKEY_LLM_PROXY_URL, no /v1 suffix
"api_key": ...,
"default_headers": ..., # client_id / client_secret header pair
"http_client": ..., # the SDK's shared httpx client
},
)Everything the SDK injects lives inside the single client_args dict that
Strands forwards to its internal OpenAI client.
Notes
- Strands forwards
client_argsverbatim to the underlying OpenAI client, so both header injection (default_headers) and transport injection (http_client) are available. - Strands also exposes lifecycle hooks (
BeforeToolCallEventand friends). The SDK uses them for the policy-termination pattern — see the error taxonomy for how aPolicyViolationshould end a run cleanly rather than trigger a retry loop.
See the error taxonomy for how proxy rejections surface as typed exceptions, and the verification ledger for the current status of every constructor signature this adapter depends on.
Last updated on