From 1d75bd8ee60f0a6cdcd7134500dc27288a528971 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 15 Oct 2026 19:43:20 -0400 Subject: [PATCH 1/5] docs(agents): define fakes and add cassette re-record gotchas Coding-agent sessions on this repo kept writing hand-made stand-ins (for example a plain function posing as an ADK tool) while believing they followed the no-mocks rule. AGENTS.md now says these count as fakes and bans MagicMock/Mock in provider integration tests. Re-record gotchas learned across weekly dependency updates (missing keys, quota errors, retired models, hand-authored cassettes, coupled sessions) only lived in one person's local agent memory. Move them into the repo so every agent sees them: - sdk-vcr-workflows: general "When Recording Fails" rules, including when to restore from git vs. re-record - sdk-dependency-updates: provider-specific list in references/session-mapping.md, linked from the re-record step Co-Authored-By: Claude Opus 5.5 --- .../skills/sdk-dependency-updates/SKILL.md | 2 ++ .../references/session-mapping.md | 32 +++++++++++++++++++ .agents/skills/sdk-vcr-workflows/SKILL.md | 25 +++++++++++++++ AGENTS.md | 2 ++ 4 files changed, 61 insertions(+) diff --git a/.agents/skills/sdk-dependency-updates/SKILL.md b/.agents/skills/sdk-dependency-updates/SKILL.md index ea455e96e..204627ff9 100644 --- a/.agents/skills/sdk-dependency-updates/SKILL.md +++ b/.agents/skills/sdk-dependency-updates/SKILL.md @@ -124,6 +124,8 @@ When several matrix keys share a directory, delete and refresh that directory on ### 6. Re-record only when justified +Before deleting anything, check the "Provider-specific re-record gotchas" in [references/session-mapping.md](./references/session-mapping.md). Some cassettes must be restored from git rather than re-recorded, and some sessions record nothing on your Python version. + For cassette refresh work, delete the affected `latest` directory first so stale responses are not silently reused: ```bash diff --git a/.agents/skills/sdk-dependency-updates/references/session-mapping.md b/.agents/skills/sdk-dependency-updates/references/session-mapping.md index 5960e0b5c..d0cb10782 100644 --- a/.agents/skills/sdk-dependency-updates/references/session-mapping.md +++ b/.agents/skills/sdk-dependency-updates/references/session-mapping.md @@ -93,3 +93,35 @@ These are usually local-environment leakage, not meaningful provider behavior: - `staging-api.braintrust.dev/version` If these show up in provider cassettes, neutralize local Braintrust env vars and re-record. + +## Provider-specific re-record gotchas + +Check this list before deleting a `latest` directory. For general rules on failed recordings, see the "When Recording Fails" section of `sdk-vcr-workflows`. + +### Never re-record (restore with `git checkout`) + +- **Instructor:** `TestInstructorOpenAISpans.test_instructor_openai_retries_then_succeeds.yaml` is hand-authored to force a validation retry. +- **LiteLLM:** `test_litellm_text_completion_metrics[*]` calls `gpt-3.5-turbo-instruct`, which has been retired (404). +- **OpenAI:** `test_openai_images_edit` is flaky against moderation (`public-figure` block). +- **Anthropic:** `test_anthropic_messages_sync_server_tool_spans` expects `https://www.braintrust.dev/docs` among the live web search results, which the search no longer returns (since Oct 2026). +- **Anthropic:** `test_anthropic_beta_messages_create_captures_compaction_metadata`: the live API now stops with `max_tokens` instead of compaction for this prompt. + +### Recording traps + +- **Harbor:** `test_atif_import_*` cassettes record Braintrust API traffic, not Harbor traffic. Run `test_harbor` with `BRAINTRUST_API_KEY` unset; `___TEST_API_KEY__` short-circuits login and points at `api.braintrust.ai`, so playback fails with a host mismatch. Do not re-record without a real org. +- **huggingface_hub:** chat tests pin `provider="cerebras"` and text-generation pins `featherless-ai`, for models HF no longer routes there, so re-recording fails with "not supported by provider". The old cassettes still play back. As of 2026-10-13 the local HF token also returns 402 "no remaining credits", so do not try to re-record huggingface_hub. +- **Mistral:** the local `MISTRAL_API_KEY` has hit persistent 429 `rate_limited` (code 1300) for hours at a time. If it does, ask the user for another key instead of retrying in a loop. +- **Anthropic:** `test_anthropic_beta_sessions_events_send_and_stream` runs a live Managed Agents session and can hang while recording. Exclude it with `-k "not test_anthropic_beta_sessions_events_send_and_stream"` and keep its old cassette. +- **Anthropic:** `test_anthropic_messages_reasoning_tokens_metrics` has several parametrizations that share two cassette names and assert against `vcr_cassette.responses[0]`. Under `--vcr-record=all` later cases fail on token counts. Delete just those two cassettes and re-run in default `once` mode. +- **pipecat:** `test_pipecat` skips on Python 3.14 (no onnxruntime wheels), so it records nothing there. Drive nox from a Python 3.13 environment before deleting its cassettes. +- **OpenAI BTX:** `rm -rf integrations/openai/cassettes/latest` also deletes `latest/btx/`, which only `nox -s "test_btx_openai(latest)" -- --vcr-record=all` re-creates. Run it after re-recording openai. + +### Coupled sessions + +- **dspy depends on the litellm pin:** `test_dspy(latest)` installs the litellm matrix `latest` pin, so a litellm bump can break dspy playback even when the dspy pin is unchanged. Re-record dspy whenever litellm bumps, after `rm -rf ~/.dspy_cache`. +- In general, grep `py/noxfile.py` for `_install_matrix_dep` to find sessions that install a bumped pin without their own matrix key changing. + +### Already handled in tests (do not undo) + +- **dspy >= 3.4:** `dspy.LM(engine="auto")` routes OpenAI through raw sockets that bypass VCR. `test_dspy.py` pins `engine="litellm"` when the parameter exists. Local playback can falsely pass from `~/.dspy_cache`, so clear it before judging dspy playback. +- **litellm Windows wheels:** vendored tiktoken files have CRLF endings, which causes a runtime fetch of `cl100k_base.tiktoken` on Windows. `test_litellm.py` sets `ignore_hosts` for `openaipublic.blob.core.windows.net`. diff --git a/.agents/skills/sdk-vcr-workflows/SKILL.md b/.agents/skills/sdk-vcr-workflows/SKILL.md index daaa2a23f..c09acef12 100644 --- a/.agents/skills/sdk-vcr-workflows/SKILL.md +++ b/.agents/skills/sdk-vcr-workflows/SKILL.md @@ -184,6 +184,31 @@ Bad reasons to re-record: If a cassette diff is large, verify that the behavioral change is truly intended before keeping it. +## When Recording Fails + +Live recording fails for reasons unrelated to the SDK change. Handle each case so a failed recording does not destroy a good cassette or leave a bad one behind. + +- **Missing or invalid API key (401/403, auth errors):** stop and ask the user for a working key. Never hand-write or edit a cassette to stand in for a recording. +- **Quota or rate limits (429, 402 "no remaining credits"):** a cassette that captured an error response is worse than the old one. Delete only the cassettes that captured the error, wait or ask for another key, then refill them with the default `once` mode. +- **Retired models or upstream drift:** if the live API no longer returns what the test asserts (a retired model returns 404, a moderation block, a search result that no longer appears, a different stop reason), keep the old cassette with `git checkout` and tell the user. Do not loosen the assertion just to get a recording. +- **Hand-authored cassettes:** some cassettes are hand-edited to force a scenario such as a validation retry. Never re-record them; restore them with `git checkout`. + +### Restore from git vs. re-record + +- Restore from git when the cassette is hand-authored, upstream behavior drifted, or the provider is unusable locally (no key, no quota). The old cassette still matches the request the SDK sends. +- Re-record when the SDK's request shape intentionally changed, or when the new pin changes the wire format and playback fails. +- If some tests in a directory may fail to record, record without deleting the directory first, so failed tests keep their old cassettes. If a test fails partway through, `git checkout` its cassette, because a partial refresh can leave truncated files. +- After any refresh, run `git status` on the cassette directory and look for ` D` entries (cassettes deleted but never recreated). + +### Traps that silently lose cassettes + +- **Skipped sessions record nothing.** If a session skips on your Python version (see `_skip_if_incompatible` and the constraints in `py/noxfile.py`), deleting its cassettes first destroys them. Run nox from a compatible interpreter instead. +- **Multi-file sessions stop at the first failing file.** After a partial failure, re-run in `once` mode to fill the files that later test files never recorded. +- **Shared cassette names under `--vcr-record=all`.** When several parametrizations share a cassette name, later cases read an earlier case's response. Delete only those cassettes and re-run in `once` mode, so the first case of each name records and the rest replay. +- **Hangs.** Tests that drive long-lived live sessions can hang while recording. Exclude them with `-k "not "` and keep their old cassettes. + +For the current list of provider-specific cases (which tests to never re-record, known retired models, sessions coupled to another provider's pin), see `.agents/skills/sdk-dependency-updates/references/session-mapping.md`. + ## Narrow Recording Strategy When you need new traffic, record the smallest thing possible: diff --git a/AGENTS.md b/AGENTS.md index 66167bc58..bb592589d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,6 +32,8 @@ Use this file as the default playbook for work in this repository. - This includes bugs in tracing/span shaping that happen after the SDK returns a real provider payload. If the behavior depends on the provider's actual response shape, treat it as VCR-first work, not mock-first work. - Be actively skeptical of mock/fake tests for provider integrations. Do not reach for mocks just because they are faster or easier to write. - Avoid mocks/fakes unless the code is purely local or there is no practical cassette-based option. + - Hand-written stand-ins for provider or framework objects count as fakes, even without `unittest.mock`: a plain function posing as a tool, a stub client or transport, or a dict/object built by hand to look like a provider response. Use the library's real classes (for example its built-in tools and real clients) and drive them with cassettes. + - Never use `MagicMock`/`Mock` in provider integration tests (`py/src/braintrust/integrations//test_*.py`). Shared helper unit tests such as `integrations/test_utils.py` are purely local and exempt. A narrow `monkeypatch` to inject an error path that recordings cannot provoke is still allowed. 7. **Do not assume optional provider packages are installed.** - Rely on the active nox session to install what it needs. From f2dde04e675e3f8e31ee6e42a45b8f131764a548 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 15 Oct 2026 19:46:36 -0400 Subject: [PATCH 2/5] test(anthropic): replace MagicMock with real spans and recordings - test_log_message_to_span_includes_stop_reason_and_stop_sequence logs to a real span through memory_logger instead of asserting on a MagicMock's call args. - test_batches_results_produces_span replays recorded results of an already-ended batch instead of patching Batches.results to return a MagicMock. It finds the batch through batches.list(), so re-recording keeps working after a given batch's results expire. The error-path test keeps its narrow unittest.mock.patch side_effect. Co-Authored-By: Claude Opus 5.5 --- ..._batches_results_produces_span[async].yaml | 238 ++++++++++++++++++ ...t_batches_results_produces_span[sync].yaml | 238 ++++++++++++++++++ ..._batches_results_produces_span[async].yaml | 232 +++++++++++++++++ ...t_batches_results_produces_span[sync].yaml | 232 +++++++++++++++++ .../integrations/anthropic/test_anthropic.py | 87 ++++--- 5 files changed, 983 insertions(+), 44 deletions(-) create mode 100644 py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml create mode 100644 py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml create mode 100644 py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml create mode 100644 py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml diff --git a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml new file mode 100644 index 000000000..0b4e6c172 --- /dev/null +++ b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml @@ -0,0 +1,238 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches?limit=20 + response: + body: + string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b35b4d63d5f4-YYZ + connection: + - keep-alive + content-length: + - '9539' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:59 GMT + request-id: + - req_011Cg4uwunAeQ1TusTp8zJZ3 + server: + - cloudflare + server-timing: + - x-originResponse;dur=129 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - AsyncAnthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - async:asyncio + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + response: + body: + string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b35cdefee21a-YYZ + connection: + - keep-alive + content-length: + - '470' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:46:00 GMT + request-id: + - req_011Cg4uwvoRzCDFC4h8zWAg5 + server: + - cloudflare + server-timing: + - x-originResponse;dur=158 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/binary + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - AsyncAnthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - async:asyncio + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + response: + body: + string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: + claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# + Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b35e3b15e21a-YYZ + connection: + - keep-alive + content-disposition: + - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/x-jsonl + date: + - Thu, 15 Oct 2026 23:46:00 GMT + request-id: + - req_011Cg4uwwpCKCDsDniZZz9sY + server: + - cloudflare + server-timing: + - x-originResponse;dur=232 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml new file mode 100644 index 000000000..3e0aa4294 --- /dev/null +++ b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml @@ -0,0 +1,238 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches?limit=20 + response: + body: + string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b355ec5ed8d9-YYZ + connection: + - keep-alive + content-length: + - '9539' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:58 GMT + request-id: + - req_011Cg4uwr3Bgop4191Dasajr + server: + - cloudflare + server-timing: + - x-originResponse;dur=139 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + response: + body: + string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b3577a890426-YYZ + connection: + - keep-alive + content-length: + - '470' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:59 GMT + request-id: + - req_011Cg4uwsDP5duxEdtLaEDc4 + server: + - cloudflare + server-timing: + - x-originResponse;dur=133 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/binary + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + response: + body: + string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: + claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# + Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b35918540426-YYZ + connection: + - keep-alive + content-disposition: + - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/x-jsonl + date: + - Thu, 15 Oct 2026 23:45:59 GMT + request-id: + - req_011Cg4uwtL6YKkQYQAFsmmvs + server: + - cloudflare + server-timing: + - x-originResponse;dur=229 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml new file mode 100644 index 000000000..6c63a717d --- /dev/null +++ b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml @@ -0,0 +1,232 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches?limit=20 + response: + body: + string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b32d5e247769-YYZ + connection: + - keep-alive + content-length: + - '9539' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:52 GMT + request-id: + - req_011Cg4uwNL4RHPByt5uzwLXa + server: + - cloudflare + server-timing: + - x-originResponse;dur=152 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - AsyncAnthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - async:asyncio + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + response: + body: + string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b32f388dea84-YYZ + connection: + - keep-alive + content-length: + - '470' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:52 GMT + request-id: + - req_011Cg4uwPchiVeFQvPGDS8M8 + server: + - cloudflare + server-timing: + - x-originResponse;dur=162 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/binary + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - AsyncAnthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - async:asyncio + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + response: + body: + string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: + claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# + Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b3309c1eea84-YYZ + connection: + - keep-alive + content-disposition: + - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/x-jsonl + date: + - Thu, 15 Oct 2026 23:45:53 GMT + request-id: + - req_011Cg4uwQcjAofFdaXgqg4BT + server: + - cloudflare + server-timing: + - x-originResponse;dur=243 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml new file mode 100644 index 000000000..c15b028e5 --- /dev/null +++ b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml @@ -0,0 +1,232 @@ +interactions: +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches?limit=20 + response: + body: + string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b3280bdaa234-YYZ + connection: + - keep-alive + content-length: + - '9539' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:51 GMT + request-id: + - req_011Cg4uwJkWLkcxfiz6eBdRX + server: + - cloudflare + server-timing: + - x-originResponse;dur=206 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + response: + body: + string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b32a1a30aacd-YYZ + connection: + - keep-alive + content-length: + - '470' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Thu, 15 Oct 2026 23:45:51 GMT + request-id: + - req_011Cg4uwL8MCz55MERtkRFG9 + server: + - cloudflare + server-timing: + - x-originResponse;dur=101 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/binary + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + response: + body: + string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: + claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# + Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2b32b2b17aacd-YYZ + connection: + - keep-alive + content-disposition: + - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/x-jsonl + date: + - Thu, 15 Oct 2026 23:45:52 GMT + request-id: + - req_011Cg4uwLrG1KPT3U1EhjuUR + server: + - cloudflare + server-timing: + - x-originResponse;dur=212 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +version: 1 diff --git a/py/src/braintrust/integrations/anthropic/test_anthropic.py b/py/src/braintrust/integrations/anthropic/test_anthropic.py index 3c03794c8..e419f41c1 100644 --- a/py/src/braintrust/integrations/anthropic/test_anthropic.py +++ b/py/src/braintrust/integrations/anthropic/test_anthropic.py @@ -182,8 +182,7 @@ def memory_logger(): yield bgl -def test_log_message_to_span_includes_stop_reason_and_stop_sequence(): - span = unittest.mock.MagicMock() +def test_log_message_to_span_includes_stop_reason_and_stop_sequence(memory_logger): message = SimpleNamespace( role="assistant", content=[{"type": "text", "text": "done"}], @@ -203,28 +202,27 @@ def test_log_message_to_span_includes_stop_reason_and_stop_sequence(): }, ) - _log_message_to_span(message, span, time_to_first_token=0.123) + with logger.start_span(name="message") as span: + _log_message_to_span(message, span, time_to_first_token=0.123) - span.log.assert_called_once_with( - output={ - "role": "assistant", - "content": [{"type": "text", "text": "done"}], - "model": MODEL, - "stop_reason": "stop_sequence", - "stop_sequence": "DONE", - }, - metrics={ - "prompt_tokens": 11.0, - "completion_tokens": 7.0, - "prompt_cached_tokens": 0.0, - "prompt_cache_creation_tokens": 0.0, - "server_tool_use_web_search_requests": 2.0, - "server_tool_use_web_fetch_requests": 1.0, - "tokens": 18.0, - "time_to_first_token": 0.123, - }, - metadata={}, - ) + (span,) = memory_logger.pop() + assert span["output"] == { + "role": "assistant", + "content": [{"type": "text", "text": "done"}], + "model": MODEL, + "stop_reason": "stop_sequence", + "stop_sequence": "DONE", + } + assert {k: v for k, v in span["metrics"].items() if k not in ("start", "end")} == { + "prompt_tokens": 11.0, + "completion_tokens": 7.0, + "prompt_cached_tokens": 0.0, + "prompt_cache_creation_tokens": 0.0, + "server_tool_use_web_search_requests": 2.0, + "server_tool_use_web_fetch_requests": 1.0, + "tokens": 18.0, + "time_to_first_token": 0.123, + } class _ToDictOnly: @@ -1797,35 +1795,36 @@ def test_sync_batches_create_multi_model_metadata(self, memory_logger): class TestBatchesResultsSpans: """Tests verifying that batches.results() produces correct spans. - Mocked because the batch results API requires a completed batch, and batches - can take up to 24 hours to finish processing. + Batches can take up to 24 hours to finish, so the success test reads the + results of an already-ended batch (such as one left by TestBatchesCreateSpans) + instead of creating one. """ + @pytest.mark.vcr @pytest.mark.asyncio # The sync case passes the batch id positionally and the async case by keyword, # covering both argument-extraction paths. - @pytest.mark.parametrize( - "is_async,batches_class,positional", - [(False, "Batches", True), (True, "AsyncBatches", False)], - ids=["sync", "async"], - ) - async def test_batches_results_produces_span(self, memory_logger, is_async, batches_class, positional): + @pytest.mark.parametrize("is_async,positional", [(False, True), (True, False)], ids=["sync", "async"]) + async def test_batches_results_produces_span(self, memory_logger, is_async, positional): assert not memory_logger.pop() + batch_id = next( + b.id + for b in _get_client().messages.batches.list(limit=20).data + if b.processing_status == "ended" and b.request_counts.succeeded + ) client = wrap_anthropic(_get_async_client() if is_async else _get_client()) - mock_decoder = unittest.mock.MagicMock() - with unittest.mock.patch( - f"anthropic.resources.messages.batches.{batches_class}.results", - return_value=mock_decoder, - ): - if positional: - result = client.messages.batches.results("msgbatch_abc123") - else: - result = client.messages.batches.results(message_batch_id="msgbatch_abc123") - if is_async: - result = await result + if positional: + result = client.messages.batches.results(batch_id) + else: + result = client.messages.batches.results(message_batch_id=batch_id) + if is_async: + result = await result + entries = [entry async for entry in result] + else: + entries = list(result) - assert result is mock_decoder + assert any(entry.result.type == "succeeded" for entry in entries) spans = memory_logger.pop() assert len(spans) == 1 @@ -1833,7 +1832,7 @@ async def test_batches_results_produces_span(self, memory_logger, is_async, batc assert span["span_attributes"]["name"] == "anthropic.messages.batches.results" assert span["span_attributes"]["type"] == "task" assert span["metadata"]["provider"] == "anthropic" - assert span["input"]["message_batch_id"] == "msgbatch_abc123" + assert span["input"]["message_batch_id"] == batch_id assert span["output"]["type"] == "jsonl_stream" def test_sync_batches_results_logs_error_on_failure(self, memory_logger): From f99bdf6be47d4f305d271fb5e7b833ab7923b363 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 15 Oct 2026 19:51:21 -0400 Subject: [PATCH 3/5] test(anthropic): drop redundant tests and the parse-detection fake - Remove test_anthropic_messages_sync and test_anthropic_messages_create_stream_true. The reasoning-tokens test covers the same create and create(stream=True) paths more strictly on both matrix versions; it now also checks the stream metadata flag. - Remove the _log_message_to_span unit test. Its usage checks duplicate test_extract_anthropic_usage, and stop_sequence is now covered by a real recording: test_anthropic_messages_model_params_inputs prompts the model to stop on END (latest cassette re-recorded). - Run the messages.parse feature-detection test against real clients on SDKs without messages.parse (0.48.0) instead of hand-written fakes. Co-Authored-By: Claude Opus 5.5 --- ...anthropic_messages_create_stream_true.yaml | 148 ----------------- .../0.48.0/test_anthropic_messages_sync.yaml | 105 ------------ ...anthropic_messages_create_stream_true.yaml | 156 ------------------ ...nthropic_messages_model_params_inputs.yaml | 68 ++++---- .../latest/test_anthropic_messages_sync.yaml | 107 ------------ .../integrations/anthropic/test_anthropic.py | 136 +-------------- 6 files changed, 45 insertions(+), 675 deletions(-) delete mode 100644 py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_create_stream_true.yaml delete mode 100644 py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_sync.yaml delete mode 100644 py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_create_stream_true.yaml delete mode 100644 py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_sync.yaml diff --git a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_create_stream_true.yaml b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_create_stream_true.yaml deleted file mode 100644 index c34401395..000000000 --- a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_create_stream_true.yaml +++ /dev/null @@ -1,148 +0,0 @@ -interactions: - - request: - body: '{"max_tokens":300,"messages":[{"role":"user","content":"What is 3*4?"}],"model":"claude-3-haiku-20240307","stream":true}' - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate - anthropic-version: - - "2023-06-01" - connection: - - keep-alive - content-length: - - "120" - content-type: - - application/json - host: - - api.anthropic.com - user-agent: - - Anthropic/Python 0.52.1 - x-stainless-arch: - - arm64 - x-stainless-async: - - "false" - x-stainless-lang: - - python - x-stainless-os: - - MacOS - x-stainless-package-version: - - 0.52.1 - x-stainless-read-timeout: - - "600" - x-stainless-retry-count: - - "0" - x-stainless-runtime: - - CPython - x-stainless-runtime-version: - - 3.13.3 - x-stainless-timeout: - - NOT_GIVEN - method: POST - uri: https://api.anthropic.com/v1/messages - response: - body: - string: 'event: message_start - - data: {"type":"message_start","message":{"id":"msg_012gPZeSmoemYgX2fdPcZFVH","type":"message","role":"assistant","model":"claude-3-haiku-20240307","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":4,"service_tier":"standard"}} } - - - event: content_block_start - - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } - - - event: ping - - data: {"type": "ping"} - - - event: content_block_delta - - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"3 - *"} } - - - event: content_block_delta - - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" - 4 ="} } - - - event: content_block_delta - - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" - 12"} } - - - event: content_block_stop - - data: {"type":"content_block_stop","index":0 } - - - event: message_delta - - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":13} } - - - event: message_stop - - data: {"type":"message_stop" } - - - ' - headers: - CF-RAY: - - 9472c88a8f806a50-EWR - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Type: - - text/event-stream; charset=utf-8 - Date: - - Thu, 29 May 2025 03:07:45 GMT - Server: - - cloudflare - Transfer-Encoding: - - chunked - X-Robots-Tag: - - none - anthropic-organization-id: - - 27796668-7351-40ac-acc4-024aee8995a5 - anthropic-ratelimit-input-tokens-limit: - - "8000000" - anthropic-ratelimit-input-tokens-remaining: - - "8000000" - anthropic-ratelimit-input-tokens-reset: - - "2025-05-29T03:07:45Z" - anthropic-ratelimit-output-tokens-limit: - - "1500000" - anthropic-ratelimit-output-tokens-remaining: - - "1500000" - anthropic-ratelimit-output-tokens-reset: - - "2025-05-29T03:07:45Z" - anthropic-ratelimit-requests-limit: - - "10000" - anthropic-ratelimit-requests-remaining: - - "9999" - anthropic-ratelimit-requests-reset: - - "2025-05-29T03:07:45Z" - anthropic-ratelimit-tokens-limit: - - "9500000" - anthropic-ratelimit-tokens-remaining: - - "9500000" - anthropic-ratelimit-tokens-reset: - - "2025-05-29T03:07:45Z" - cf-cache-status: - - DYNAMIC - request-id: - - req_011CPb5qta7AfiZd2KcxncsY - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - via: - - 1.1 google - status: - code: 200 - message: OK -version: 1 diff --git a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_sync.yaml b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_sync.yaml deleted file mode 100644 index 95676479a..000000000 --- a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/test_anthropic_messages_sync.yaml +++ /dev/null @@ -1,105 +0,0 @@ -interactions: - - request: - body: '{"max_tokens":300,"messages":[{"role":"user","content":"what''s 2+2?"}],"model":"claude-3-haiku-20240307"}' - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate - anthropic-version: - - "2023-06-01" - connection: - - keep-alive - content-length: - - "105" - content-type: - - application/json - host: - - api.anthropic.com - user-agent: - - Anthropic/Python 0.52.1 - x-stainless-arch: - - arm64 - x-stainless-async: - - "false" - x-stainless-lang: - - python - x-stainless-os: - - MacOS - x-stainless-package-version: - - 0.52.1 - x-stainless-read-timeout: - - "600" - x-stainless-retry-count: - - "0" - x-stainless-runtime: - - CPython - x-stainless-runtime-version: - - 3.13.3 - x-stainless-timeout: - - "600" - method: POST - uri: https://api.anthropic.com/v1/messages - response: - body: - string: !!binary | - H4sIAAAAAAAAA2SPQUsDMRSE/8ucs2W7XRRyKx4KVYseeqlICMljG7tN1rwXUZb977LFguLpwXwz - w5sRwUPjzJ2pl0/dw/5wv2n228fd3fN6sw4+H96gIF8DzS5ith1BIad+FixzYLFRoHBOnnpouN4W - T9WqOtpwKlVTN229qm+h4FIUigL9Ml4bhT7n7OVotAtMrwosaTCZLKcIDYreSMkRP4DpvVB0BB1L - 3yuUy0t6RIhDESPpRJGhl62Cs+5IxmWyElI0fw31lWey/j9LRX4rNwpM+SM4MhIoQ2Pe7W32mKZv - AAAA//8DAOBQupxFAQAA - headers: - CF-RAY: - - 9472c8abe82e4346-EWR - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Thu, 29 May 2025 03:07:51 GMT - Server: - - cloudflare - Transfer-Encoding: - - chunked - X-Robots-Tag: - - none - anthropic-organization-id: - - 27796668-7351-40ac-acc4-024aee8995a5 - anthropic-ratelimit-input-tokens-limit: - - "8000000" - anthropic-ratelimit-input-tokens-remaining: - - "8000000" - anthropic-ratelimit-input-tokens-reset: - - "2025-05-29T03:07:51Z" - anthropic-ratelimit-output-tokens-limit: - - "1500000" - anthropic-ratelimit-output-tokens-remaining: - - "1500000" - anthropic-ratelimit-output-tokens-reset: - - "2025-05-29T03:07:51Z" - anthropic-ratelimit-requests-limit: - - "10000" - anthropic-ratelimit-requests-remaining: - - "9999" - anthropic-ratelimit-requests-reset: - - "2025-05-29T03:07:51Z" - anthropic-ratelimit-tokens-limit: - - "9500000" - anthropic-ratelimit-tokens-remaining: - - "9500000" - anthropic-ratelimit-tokens-reset: - - "2025-05-29T03:07:51Z" - cf-cache-status: - - DYNAMIC - request-id: - - req_011CPb5rJW239uEPcCN6bpZm - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - via: - - 1.1 google - status: - code: 200 - message: OK -version: 1 diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_create_stream_true.yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_create_stream_true.yaml deleted file mode 100644 index 13722608a..000000000 --- a/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_create_stream_true.yaml +++ /dev/null @@ -1,156 +0,0 @@ -interactions: -- request: - body: '{"max_tokens":300,"messages":[{"role":"user","content":"What is 3*4?"}],"model":"claude-haiku-4-5-20251001","stream":true}' - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate, zstd - anthropic-version: - - '2023-06-01' - connection: - - keep-alive - content-length: - - '122' - content-type: - - application/json - host: - - api.anthropic.com - user-agent: - - Anthropic/Python 1.13.0 - x-stainless-arch: - - arm64 - x-stainless-async: - - 'false' - x-stainless-lang: - - python - x-stainless-os: - - MacOS - x-stainless-package-version: - - 1.13.0 - x-stainless-read-timeout: - - '600' - x-stainless-retry-count: - - '0' - x-stainless-runtime: - - CPython - x-stainless-runtime-version: - - 3.14.7 - x-stainless-timeout: - - NOT_GIVEN - method: POST - uri: https://api.anthropic.com/v1/messages - response: - body: - string: 'event: message_start - - data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011CfzNcn799c4J3KUKUdkHH","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":4,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null} } - - - event: content_block_start - - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} - - - event: ping - - data: {"type": "ping"} - - - event: content_block_delta - - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"3 - *"} } - - - event: content_block_delta - - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" - 4 ="} } - - - event: content_block_delta - - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" - 12"}} - - - event: content_block_stop - - data: {"type":"content_block_stop","index":0 } - - - event: message_delta - - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":13}} - - - event: message_stop - - data: {"type":"message_stop" } - - - ' - headers: - anthropic-organization-id: - - 27796668-7351-40ac-acc4-024aee8995a5 - anthropic-ratelimit-input-tokens-limit: - - '10000000' - anthropic-ratelimit-input-tokens-remaining: - - '10000000' - anthropic-ratelimit-input-tokens-reset: - - '2026-10-13T14:12:46Z' - anthropic-ratelimit-output-tokens-limit: - - '2000000' - anthropic-ratelimit-output-tokens-remaining: - - '2000000' - anthropic-ratelimit-output-tokens-reset: - - '2026-10-13T14:12:46Z' - anthropic-ratelimit-requests-limit: - - '20000' - anthropic-ratelimit-requests-remaining: - - '19999' - anthropic-ratelimit-requests-reset: - - '2026-10-13T14:12:46Z' - anthropic-ratelimit-tokens-limit: - - '12000000' - anthropic-ratelimit-tokens-remaining: - - '12000000' - anthropic-ratelimit-tokens-reset: - - '2026-10-13T14:12:46Z' - anthropic-workspace-id: - - wrkspc_018bFG1FgNVWqx5pthtdGTzS - cache-control: - - no-cache - cf-cache-status: - - DYNAMIC - cf-ray: - - a49ef0eaa986ac46-YYZ - connection: - - keep-alive - content-length: - - '1456' - content-security-policy: - - default-src 'none'; frame-ancestors 'none' - content-type: - - text/event-stream; charset=utf-8 - date: - - Tue, 13 Oct 2026 14:12:46 GMT - request-id: - - req_011CfzNcmsFgf4vJ5MHjzRga - server: - - cloudflare - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - traceresponse: - - 00-2bbfd482a75211a8ca4fe446511ab729-aa9ea2434cffe03b-01 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-robots-tag: - - none - status: - code: 200 - message: OK -version: 1 diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_model_params_inputs.yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_model_params_inputs.yaml index 56949fa0b..eaabc442d 100644 --- a/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_model_params_inputs.yaml +++ b/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_model_params_inputs.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"max_tokens":300,"messages":[{"role":"user","content":"what is 1+1?"}],"model":"claude-haiku-4-5-20251001","stop_sequences":["END"],"system":"just - return the number"}' + body: '{"max_tokens":300,"messages":[{"role":"user","content":"what is 1+1?"}],"model":"claude-haiku-4-5-20251001","stop_sequences":["END"],"system":"Return + just the number, then the word END."}' headers: accept: - application/json @@ -12,7 +12,7 @@ interactions: connection: - keep-alive content-length: - - '167' + - '187' content-type: - application/json host: @@ -43,7 +43,7 @@ interactions: uri: https://api.anthropic.com/v1/messages response: body: - string: '{"model":"claude-haiku-4-5-20251001","id":"msg_011CfzNd8KpkAGWVtoKgbFey","type":"message","role":"assistant","content":[{"type":"text","text":"2"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":18,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":5,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null}' + string: '{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4vEVTQfFkhtGAdEKm5y","type":"message","role":"assistant","content":[{"type":"text","text":"2\n\n"}],"container":null,"stop_reason":"stop_sequence","stop_sequence":"END","stop_details":null,"usage":{"input_tokens":24,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":4,"service_tier":"standard","inference_geo":"not_available","speed":"standard"},"diagnostics":null}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -52,49 +52,49 @@ interactions: anthropic-ratelimit-input-tokens-remaining: - '10000000' anthropic-ratelimit-input-tokens-reset: - - '2026-10-13T14:12:50Z' + - '2026-10-15T23:49:44Z' anthropic-ratelimit-output-tokens-limit: - '2000000' anthropic-ratelimit-output-tokens-remaining: - '2000000' anthropic-ratelimit-output-tokens-reset: - - '2026-10-13T14:12:50Z' + - '2026-10-15T23:49:44Z' anthropic-ratelimit-requests-limit: - '20000' anthropic-ratelimit-requests-remaining: - '19999' anthropic-ratelimit-requests-reset: - - '2026-10-13T14:12:50Z' + - '2026-10-15T23:49:44Z' anthropic-ratelimit-tokens-limit: - '12000000' anthropic-ratelimit-tokens-remaining: - '12000000' anthropic-ratelimit-tokens-reset: - - '2026-10-13T14:12:50Z' + - '2026-10-15T23:49:44Z' anthropic-workspace-id: - wrkspc_018bFG1FgNVWqx5pthtdGTzS cf-cache-status: - DYNAMIC cf-ray: - - a49ef1085942aaf1-YYZ + - a4b2b8d7b944e7e3-YYZ connection: - keep-alive content-length: - - '493' + - '522' content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/json date: - - Tue, 13 Oct 2026 14:12:50 GMT + - Thu, 15 Oct 2026 23:49:44 GMT request-id: - - req_011CfzNd87BSoMkBrh4RNRTk + - req_011Cg4vEUcoxcRnEfFRCcwtL server: - cloudflare strict-transport-security: - max-age=31536000; includeSubDomains; preload traceresponse: - - 00-e86f9e1772d831203240338886718ca6-fdbf4d83acbbffee-01 + - 00-7033720e592849b25414be502f06ae07-8eef50783e6a08de-01 transfer-encoding: - chunked vary: @@ -105,8 +105,8 @@ interactions: code: 200 message: OK - request: - body: '{"max_tokens":300,"messages":[{"role":"user","content":"what is 1+1?"}],"model":"claude-haiku-4-5-20251001","stop_sequences":["END"],"system":"just - return the number","stream":true}' + body: '{"max_tokens":300,"messages":[{"role":"user","content":"what is 1+1?"}],"model":"claude-haiku-4-5-20251001","stop_sequences":["END"],"system":"Return + just the number, then the word END.","stream":true}' headers: accept: - application/json @@ -117,7 +117,7 @@ interactions: connection: - keep-alive content-length: - - '181' + - '201' content-type: - application/json host: @@ -154,12 +154,12 @@ interactions: body: string: 'event: message_start - data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011CfzNd9z38GDdakGTZ4H7A","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":18,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null} } + data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4vEXVhPdfgw2KyZSvgB","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":24,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard","inference_geo":"not_available","speed":"standard"},"diagnostics":null} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: ping @@ -169,23 +169,27 @@ interactions: event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"2"} - } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"2"} } + + + event: content_block_delta + + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":18,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5} } + data: {"type":"message_delta","delta":{"stop_reason":"stop_sequence","stop_sequence":"END","stop_details":null,"container":null},"usage":{"input_tokens":24,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":4} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } ' @@ -197,25 +201,25 @@ interactions: anthropic-ratelimit-input-tokens-remaining: - '10000000' anthropic-ratelimit-input-tokens-reset: - - '2026-10-13T14:12:51Z' + - '2026-10-15T23:49:45Z' anthropic-ratelimit-output-tokens-limit: - '2000000' anthropic-ratelimit-output-tokens-remaining: - '2000000' anthropic-ratelimit-output-tokens-reset: - - '2026-10-13T14:12:51Z' + - '2026-10-15T23:49:45Z' anthropic-ratelimit-requests-limit: - '20000' anthropic-ratelimit-requests-remaining: - '19999' anthropic-ratelimit-requests-reset: - - '2026-10-13T14:12:51Z' + - '2026-10-15T23:49:45Z' anthropic-ratelimit-tokens-limit: - '12000000' anthropic-ratelimit-tokens-remaining: - '12000000' anthropic-ratelimit-tokens-reset: - - '2026-10-13T14:12:51Z' + - '2026-10-15T23:49:45Z' anthropic-workspace-id: - wrkspc_018bFG1FgNVWqx5pthtdGTzS cache-control: @@ -223,25 +227,25 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a49ef10acc57aaf1-YYZ + - a4b2b8dbccefe7e3-YYZ connection: - keep-alive content-length: - - '1205' + - '1368' content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - text/event-stream; charset=utf-8 date: - - Tue, 13 Oct 2026 14:12:51 GMT + - Thu, 15 Oct 2026 23:49:45 GMT request-id: - - req_011CfzNd9ndc96vQypXqhxkA + - req_011Cg4vEXJYEreS4x9ue6iYB server: - cloudflare strict-transport-security: - max-age=31536000; includeSubDomains; preload traceresponse: - - 00-5c77a0771912bbdebf3e6498deb6885a-13c27f4a087cd5ea-01 + - 00-b38040c1e499ea675692127f6995314d-0cd4a41aa4bad69a-01 transfer-encoding: - chunked vary: diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_sync.yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_sync.yaml deleted file mode 100644 index 996721494..000000000 --- a/py/src/braintrust/integrations/anthropic/cassettes/latest/test_anthropic_messages_sync.yaml +++ /dev/null @@ -1,107 +0,0 @@ -interactions: -- request: - body: '{"max_tokens":300,"messages":[{"role":"user","content":"what''s 2+2?"}],"model":"claude-haiku-4-5-20251001"}' - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate, zstd - anthropic-version: - - '2023-06-01' - connection: - - keep-alive - content-length: - - '107' - content-type: - - application/json - host: - - api.anthropic.com - user-agent: - - Anthropic/Python 1.13.0 - x-stainless-arch: - - arm64 - x-stainless-async: - - 'false' - x-stainless-lang: - - python - x-stainless-os: - - MacOS - x-stainless-package-version: - - 1.13.0 - x-stainless-read-timeout: - - '600' - x-stainless-retry-count: - - '0' - x-stainless-runtime: - - CPython - x-stainless-runtime-version: - - 3.14.7 - x-stainless-timeout: - - '600' - method: POST - uri: https://api.anthropic.com/v1/messages - response: - body: - string: '{"model":"claude-haiku-4-5-20251001","id":"msg_011CfzNdEsU5DNJNWnzTh4dR","type":"message","role":"assistant","content":[{"type":"text","text":"2 - + 2 = 4"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null}' - headers: - anthropic-organization-id: - - 27796668-7351-40ac-acc4-024aee8995a5 - anthropic-ratelimit-input-tokens-limit: - - '10000000' - anthropic-ratelimit-input-tokens-remaining: - - '10000000' - anthropic-ratelimit-input-tokens-reset: - - '2026-10-13T14:12:52Z' - anthropic-ratelimit-output-tokens-limit: - - '2000000' - anthropic-ratelimit-output-tokens-remaining: - - '2000000' - anthropic-ratelimit-output-tokens-reset: - - '2026-10-13T14:12:52Z' - anthropic-ratelimit-requests-limit: - - '20000' - anthropic-ratelimit-requests-remaining: - - '19999' - anthropic-ratelimit-requests-reset: - - '2026-10-13T14:12:52Z' - anthropic-ratelimit-tokens-limit: - - '12000000' - anthropic-ratelimit-tokens-remaining: - - '12000000' - anthropic-ratelimit-tokens-reset: - - '2026-10-13T14:12:52Z' - anthropic-workspace-id: - - wrkspc_018bFG1FgNVWqx5pthtdGTzS - cf-cache-status: - - DYNAMIC - cf-ray: - - a49ef111c96844b0-YYZ - connection: - - keep-alive - content-length: - - '502' - content-security-policy: - - default-src 'none'; frame-ancestors 'none' - content-type: - - application/json - date: - - Tue, 13 Oct 2026 14:12:52 GMT - request-id: - - req_011CfzNdEdLZ1wu4Fxsq8qvP - server: - - cloudflare - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - traceresponse: - - 00-d0a5bd5418c4cc2f2b40b4e274a63013-867d0f8cc56d92eb-01 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-robots-tag: - - none - status: - code: 200 - message: OK -version: 1 diff --git a/py/src/braintrust/integrations/anthropic/test_anthropic.py b/py/src/braintrust/integrations/anthropic/test_anthropic.py index e419f41c1..cfa35dc47 100644 --- a/py/src/braintrust/integrations/anthropic/test_anthropic.py +++ b/py/src/braintrust/integrations/anthropic/test_anthropic.py @@ -14,11 +14,7 @@ from braintrust import Attachment, logger from braintrust.integrations.anthropic import AnthropicIntegration, wrap_anthropic from braintrust.integrations.anthropic._utils import _try_to_dict, extract_anthropic_usage -from braintrust.integrations.anthropic.tracing import ( - TracedMessageStream, - _log_message_to_span, - _normalize_anthropic_input, -) +from braintrust.integrations.anthropic.tracing import TracedMessageStream, _normalize_anthropic_input from braintrust.integrations.test_utils import verify_autoinstrument_script from braintrust.span_types import SpanTypeAttribute from braintrust.test_helpers import find_span_by_name, find_spans_by_type, init_test_logger @@ -98,16 +94,10 @@ def _skip_if_messages_parse_unsupported(): def test_wrap_anthropic_preserves_messages_parse_feature_detection(): - class MessagesWithoutParse: - pass - - class FakeAnthropic: - messages = MessagesWithoutParse() - - class FakeAsyncAnthropic: - messages = MessagesWithoutParse() + if hasattr(_get_client().messages, "parse"): + pytest.skip("Installed anthropic SDK supports messages.parse") - for client in (FakeAnthropic(), FakeAsyncAnthropic()): + for client in (_get_client(), _get_async_client()): messages = wrap_anthropic(client).messages assert not hasattr(messages, "parse") with pytest.raises(AttributeError): @@ -182,49 +172,6 @@ def memory_logger(): yield bgl -def test_log_message_to_span_includes_stop_reason_and_stop_sequence(memory_logger): - message = SimpleNamespace( - role="assistant", - content=[{"type": "text", "text": "done"}], - model=MODEL, - stop_reason="stop_sequence", - stop_sequence="DONE", - stop_details=None, - usage={ - "input_tokens": 11, - "output_tokens": 7, - "cache_read_input_tokens": 0, - "cache_creation_input_tokens": 0, - "server_tool_use": { - "web_search_requests": 2, - "web_fetch_requests": 1, - }, - }, - ) - - with logger.start_span(name="message") as span: - _log_message_to_span(message, span, time_to_first_token=0.123) - - (span,) = memory_logger.pop() - assert span["output"] == { - "role": "assistant", - "content": [{"type": "text", "text": "done"}], - "model": MODEL, - "stop_reason": "stop_sequence", - "stop_sequence": "DONE", - } - assert {k: v for k, v in span["metrics"].items() if k not in ("start", "end")} == { - "prompt_tokens": 11.0, - "completion_tokens": 7.0, - "prompt_cached_tokens": 0.0, - "prompt_cache_creation_tokens": 0.0, - "server_tool_use_web_search_requests": 2.0, - "server_tool_use_web_fetch_requests": 1.0, - "tokens": 18.0, - "time_to_first_token": 0.123, - } - - class _ToDictOnly: __slots__ = ("_payload",) @@ -821,6 +768,7 @@ async def test_anthropic_messages_reasoning_tokens_metrics( assert span["metadata"]["model"] == LATEST_MODEL assert span["metadata"]["provider"] == "anthropic" assert span["metadata"]["max_tokens"] == params["max_tokens"] + assert span["metadata"].get("stream") is (True if mode == "create_stream" else None) assert span["input"] == params["messages"] assert span["output"]["role"] == "assistant" assert span["output"]["model"] == wire_model @@ -1010,40 +958,6 @@ def test_anthropic_messages_create_with_document_attachment_input(memory_logger) assert PDF_BASE64 not in str(span["input"]) -@pytest.mark.vcr -def test_anthropic_messages_create_stream_true(memory_logger): - assert not memory_logger.pop() - - client = wrap_anthropic(_get_client()) - kws = { - "model": MODEL, - "max_tokens": 300, - "messages": [{"role": "user", "content": "What is 3*4?"}], - "stream": True, - } - - start = time.time() - with client.messages.create(**kws) as out: - msgs = [m for m in out] - end = time.time() - - assert msgs # a very coarse grained check that this works - - spans = memory_logger.pop() - assert len(spans) == 1 - span = spans[0] - assert span["metadata"]["model"] == MODEL - assert span["metadata"]["provider"] == "anthropic" - assert span["metadata"]["max_tokens"] == 300 - assert span["metadata"]["stream"] == True - metrics = span["metrics"] - _assert_metrics_are_valid(metrics, start, end) - assert span["input"] == kws["messages"] - assert span["output"] - assert span["output"]["role"] == "assistant" - assert "12" in span["output"]["content"][0]["text"] - - @pytest.mark.vcr def test_anthropic_messages_create_tracks_structured_outputs_metadata(memory_logger): assert not memory_logger.pop() @@ -1173,6 +1087,7 @@ def test_anthropic_messages_model_params_inputs(memory_logger): kw.update(temperature=0.5, top_p=0.5) else: # Anthropic 1.0 removed temperature and top_p from Messages.create(). + kw["system"] = "Return just the number, then the word END." kw["stop_sequences"] = ["END"] def _with_messages_create(): @@ -1186,7 +1101,7 @@ def _with_messages_stream(): for f in [_with_messages_create, _with_messages_stream]: msg = f() - assert msg.content[0].text == "2" + assert msg.content[0].text.strip() == "2" logs = memory_logger.pop() assert len(logs) == 1 @@ -1205,6 +1120,8 @@ def _with_messages_stream(): assert log["metadata"]["top_p"] == 0.5 else: assert log["metadata"]["stop_sequences"] == ["END"] + assert msg.stop_reason == log["output"]["stop_reason"] == "stop_sequence" + assert msg.stop_sequence == log["output"]["stop_sequence"] == "END" @pytest.mark.vcr @@ -1252,41 +1169,6 @@ def test_anthropic_messages_stream_errors(memory_logger): assert span["metrics"]["end"] > 0 -@pytest.mark.vcr -def test_anthropic_messages_sync(memory_logger): - assert not memory_logger.pop() - - client = wrap_anthropic(_get_client()) - - msg_in = {"role": "user", "content": "what's 2+2?"} - - start = time.time() - msg = client.messages.create(model=MODEL, max_tokens=300, messages=[msg_in]) - end = time.time() - - text = msg.content[0].text - assert text - - # verify we generated the right spans. - logs = memory_logger.pop() - - assert len(logs) == 1 - log = logs[0] - assert "2+2" in str(log["input"]) - assert "4" in str(log["output"]) - assert log["project_id"] == PROJECT_NAME - assert log["span_id"] - assert log["root_span_id"] - attrs = log["span_attributes"] - assert attrs["type"] == "llm" - assert "anthropic" in attrs["name"] - metrics = log["metrics"] - _assert_metrics_are_valid(metrics, start, end) - assert log["metadata"]["model"] == MODEL - assert log["output"]["model"] == msg.model - assert log["output"]["stop_reason"] == msg.stop_reason - - @pytest.mark.vcr def test_anthropic_messages_sync_server_tool_spans(memory_logger): _skip_if_server_tool_content_blocks_unsupported() From 94eac8b83001b308061096335181602a6be74453 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 15 Oct 2026 20:05:32 -0400 Subject: [PATCH 4/5] docs(skills): drop provider-specific re-record gotchas Keep only the general recording-failure rules in sdk-vcr-workflows. Co-Authored-By: Claude Opus 5.5 --- .../skills/sdk-dependency-updates/SKILL.md | 2 -- .../references/session-mapping.md | 32 ------------------- .agents/skills/sdk-vcr-workflows/SKILL.md | 2 -- 3 files changed, 36 deletions(-) diff --git a/.agents/skills/sdk-dependency-updates/SKILL.md b/.agents/skills/sdk-dependency-updates/SKILL.md index 204627ff9..ea455e96e 100644 --- a/.agents/skills/sdk-dependency-updates/SKILL.md +++ b/.agents/skills/sdk-dependency-updates/SKILL.md @@ -124,8 +124,6 @@ When several matrix keys share a directory, delete and refresh that directory on ### 6. Re-record only when justified -Before deleting anything, check the "Provider-specific re-record gotchas" in [references/session-mapping.md](./references/session-mapping.md). Some cassettes must be restored from git rather than re-recorded, and some sessions record nothing on your Python version. - For cassette refresh work, delete the affected `latest` directory first so stale responses are not silently reused: ```bash diff --git a/.agents/skills/sdk-dependency-updates/references/session-mapping.md b/.agents/skills/sdk-dependency-updates/references/session-mapping.md index d0cb10782..5960e0b5c 100644 --- a/.agents/skills/sdk-dependency-updates/references/session-mapping.md +++ b/.agents/skills/sdk-dependency-updates/references/session-mapping.md @@ -93,35 +93,3 @@ These are usually local-environment leakage, not meaningful provider behavior: - `staging-api.braintrust.dev/version` If these show up in provider cassettes, neutralize local Braintrust env vars and re-record. - -## Provider-specific re-record gotchas - -Check this list before deleting a `latest` directory. For general rules on failed recordings, see the "When Recording Fails" section of `sdk-vcr-workflows`. - -### Never re-record (restore with `git checkout`) - -- **Instructor:** `TestInstructorOpenAISpans.test_instructor_openai_retries_then_succeeds.yaml` is hand-authored to force a validation retry. -- **LiteLLM:** `test_litellm_text_completion_metrics[*]` calls `gpt-3.5-turbo-instruct`, which has been retired (404). -- **OpenAI:** `test_openai_images_edit` is flaky against moderation (`public-figure` block). -- **Anthropic:** `test_anthropic_messages_sync_server_tool_spans` expects `https://www.braintrust.dev/docs` among the live web search results, which the search no longer returns (since Oct 2026). -- **Anthropic:** `test_anthropic_beta_messages_create_captures_compaction_metadata`: the live API now stops with `max_tokens` instead of compaction for this prompt. - -### Recording traps - -- **Harbor:** `test_atif_import_*` cassettes record Braintrust API traffic, not Harbor traffic. Run `test_harbor` with `BRAINTRUST_API_KEY` unset; `___TEST_API_KEY__` short-circuits login and points at `api.braintrust.ai`, so playback fails with a host mismatch. Do not re-record without a real org. -- **huggingface_hub:** chat tests pin `provider="cerebras"` and text-generation pins `featherless-ai`, for models HF no longer routes there, so re-recording fails with "not supported by provider". The old cassettes still play back. As of 2026-10-13 the local HF token also returns 402 "no remaining credits", so do not try to re-record huggingface_hub. -- **Mistral:** the local `MISTRAL_API_KEY` has hit persistent 429 `rate_limited` (code 1300) for hours at a time. If it does, ask the user for another key instead of retrying in a loop. -- **Anthropic:** `test_anthropic_beta_sessions_events_send_and_stream` runs a live Managed Agents session and can hang while recording. Exclude it with `-k "not test_anthropic_beta_sessions_events_send_and_stream"` and keep its old cassette. -- **Anthropic:** `test_anthropic_messages_reasoning_tokens_metrics` has several parametrizations that share two cassette names and assert against `vcr_cassette.responses[0]`. Under `--vcr-record=all` later cases fail on token counts. Delete just those two cassettes and re-run in default `once` mode. -- **pipecat:** `test_pipecat` skips on Python 3.14 (no onnxruntime wheels), so it records nothing there. Drive nox from a Python 3.13 environment before deleting its cassettes. -- **OpenAI BTX:** `rm -rf integrations/openai/cassettes/latest` also deletes `latest/btx/`, which only `nox -s "test_btx_openai(latest)" -- --vcr-record=all` re-creates. Run it after re-recording openai. - -### Coupled sessions - -- **dspy depends on the litellm pin:** `test_dspy(latest)` installs the litellm matrix `latest` pin, so a litellm bump can break dspy playback even when the dspy pin is unchanged. Re-record dspy whenever litellm bumps, after `rm -rf ~/.dspy_cache`. -- In general, grep `py/noxfile.py` for `_install_matrix_dep` to find sessions that install a bumped pin without their own matrix key changing. - -### Already handled in tests (do not undo) - -- **dspy >= 3.4:** `dspy.LM(engine="auto")` routes OpenAI through raw sockets that bypass VCR. `test_dspy.py` pins `engine="litellm"` when the parameter exists. Local playback can falsely pass from `~/.dspy_cache`, so clear it before judging dspy playback. -- **litellm Windows wheels:** vendored tiktoken files have CRLF endings, which causes a runtime fetch of `cl100k_base.tiktoken` on Windows. `test_litellm.py` sets `ignore_hosts` for `openaipublic.blob.core.windows.net`. diff --git a/.agents/skills/sdk-vcr-workflows/SKILL.md b/.agents/skills/sdk-vcr-workflows/SKILL.md index c09acef12..5be3298df 100644 --- a/.agents/skills/sdk-vcr-workflows/SKILL.md +++ b/.agents/skills/sdk-vcr-workflows/SKILL.md @@ -207,8 +207,6 @@ Live recording fails for reasons unrelated to the SDK change. Handle each case s - **Shared cassette names under `--vcr-record=all`.** When several parametrizations share a cassette name, later cases read an earlier case's response. Delete only those cassettes and re-run in `once` mode, so the first case of each name records and the rest replay. - **Hangs.** Tests that drive long-lived live sessions can hang while recording. Exclude them with `-k "not "` and keep their old cassettes. -For the current list of provider-specific cases (which tests to never re-record, known retired models, sessions coupled to another provider's pin), see `.agents/skills/sdk-dependency-updates/references/session-mapping.md`. - ## Narrow Recording Strategy When you need new traffic, record the smallest thing possible: From f6b7789e1308009d9a2779f796421ce2f0b348be Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 15 Oct 2026 20:23:09 -0400 Subject: [PATCH 5/5] test(anthropic): record batch results from a test-owned batch test_batches_results_produces_span picked any recently ended batch from batches.list(). With a contributor's key that could write an unrelated batch's prompts and outputs into a checked-in cassette, and on a fresh workspace it raised StopIteration. The test now creates its own two-request batch and polls until it ends (sleeping only while recording), then asserts the results are exactly req-1 and req-2. It uses LATEST_MODEL because the 0.48.0 default, claude-3-haiku-20240307, is retired and its batch requests now error. Co-Authored-By: Claude Opus 5.5 --- ..._batches_results_produces_span[async].yaml | 1014 +++++++++++++++- ...t_batches_results_produces_span[sync].yaml | 934 +++++++++++++- ..._batches_results_produces_span[async].yaml | 1070 ++++++++++++++++- ...t_batches_results_produces_span[sync].yaml | 914 +++++++++++++- .../integrations/anthropic/test_anthropic.py | 33 +- 5 files changed, 3864 insertions(+), 101 deletions(-) diff --git a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml index 0b4e6c172..5b465e01c 100644 --- a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml +++ b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml @@ -1,4 +1,970 @@ interactions: +- request: + body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 2+2?"}]}},{"custom_id":"req-2","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 3+3?"}]}}]}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-length: + - '294' + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: POST + uri: https://api.anthropic.com/v1/messages/batches + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-ratelimit-batch-requests-limit: + - '500000' + anthropic-ratelimit-batch-requests-remaining: + - '499998' + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e56fec3e92b6-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:20:11 GMT + request-id: + - req_011Cg4xZ7vNGuCwDeR7bd5WE + server: + - cloudflare + server-timing: + - x-originResponse;dur=277 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e5b0dd6636a6-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:20:21 GMT + request-id: + - req_011Cg4xZtVWXGZ6QYrsC81n8 + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=118 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e5f1095eaaf7-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:20:31 GMT + request-id: + - req_011Cg4xaeGmfcnm9qjgVLjAU + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=102 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e630eae04b56-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:20:41 GMT + request-id: + - req_011Cg4xbPxL7KY5Y2fyammS2 + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=103 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e670de0dab54-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:20:52 GMT + request-id: + - req_011Cg4xc9j6h234grEsnxdXQ + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=133 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e6b0e841ab88-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:21:02 GMT + request-id: + - req_011Cg4xcuYqbWpt6BpcfnCNf + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=107 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e6f0d874aadf-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:21:12 GMT + request-id: + - req_011Cg4xdfJ8CpvZAd7kgYHqf + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=118 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e730cda9ec71-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:21:22 GMT + request-id: + - req_011Cg4xeR9bmYNtLTCrpfEAB + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=154 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e770fbfdebc0-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:21:33 GMT + request-id: + - req_011Cg4xfAwMyfoc9NqaDqTAU + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=153 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e7b1af05f80a-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:21:43 GMT + request-id: + - req_011Cg4xfw9fcQC43B1c1p6i9 + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=102 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e7f19e35086a-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:21:53 GMT + request-id: + - req_011Cg4xggsxG9oRNczE8MkNG + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=133 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr + response: + body: + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e831ccd83823-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:22:03 GMT + request-id: + - req_011Cg4xhSq8rytvd8VtWKuYq + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=113 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK - request: body: '' headers: @@ -37,10 +1003,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches?limit=20 + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr response: body: - string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:22:08.085125+00:00","created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -49,23 +1015,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b35b4d63d5f4-YYZ + - a4b2e871a888103a-YYZ connection: - keep-alive content-length: - - '9539' + - '470' content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:59 GMT + - Fri, 16 Oct 2026 00:22:14 GMT request-id: - - req_011Cg4uwunAeQ1TusTp8zJZ3 + - req_011Cg4xiCZAz5dKwoiGJdvba server: - cloudflare server-timing: - - x-originResponse;dur=129 + - x-originResponse;dur=127 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -115,10 +1081,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr response: body: - string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + string: '{"id":"msgbatch_01GiQDBfJxsnmLJCJgTkouvr","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:22:08.085125+00:00","created_at":"2026-10-16T00:20:11.136965+00:00","expires_at":"2026-10-17T00:20:11.136965+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -127,7 +1093,7 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b35cdefee21a-YYZ + - a4b2e8732d95aa96-YYZ connection: - keep-alive content-length: @@ -137,13 +1103,13 @@ interactions: content-type: - application/json date: - - Thu, 15 Oct 2026 23:46:00 GMT + - Fri, 16 Oct 2026 00:22:14 GMT request-id: - - req_011Cg4uwvoRzCDFC4h8zWAg5 + - req_011Cg4xiDXxuBQLNdnDeJLrT server: - cloudflare server-timing: - - x-originResponse;dur=158 + - x-originResponse;dur=112 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -193,12 +1159,16 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01GiQDBfJxsnmLJCJgTkouvr/results response: body: - string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: - claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# - Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + string: '{"custom_id":"req-2","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4xcLcCRugkyB99jaHyE","type":"message","role":"assistant","content":[{"type":"text","text":"3 + + 3 = 6"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + {"custom_id":"req-1","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4xdEtBYpmLzhJpR3mW5","type":"message","role":"assistant","content":[{"type":"text","text":"2 + + 2 = 4"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + ' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -207,23 +1177,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b35e3b15e21a-YYZ + - a4b2e8743ecbaa96-YYZ connection: - keep-alive content-disposition: - - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + - attachment; filename*=utf-8''msgbatch_01GiQDBfJxsnmLJCJgTkouvr_results.jsonl content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/x-jsonl date: - - Thu, 15 Oct 2026 23:46:00 GMT + - Fri, 16 Oct 2026 00:22:14 GMT request-id: - - req_011Cg4uwwpCKCDsDniZZz9sY + - req_011Cg4xiEG7e1tVF5cibyyi7 server: - cloudflare server-timing: - - x-originResponse;dur=232 + - x-originResponse;dur=171 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: diff --git a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml index 3e0aa4294..7d86b543f 100644 --- a/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml +++ b/py/src/braintrust/integrations/anthropic/cassettes/0.48.0/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml @@ -1,4 +1,890 @@ interactions: +- request: + body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 2+2?"}]}},{"custom_id":"req-2","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 3+3?"}]}}]}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-length: + - '294' + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: POST + uri: https://api.anthropic.com/v1/messages/batches + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-ratelimit-batch-requests-limit: + - '500000' + anthropic-ratelimit-batch-requests-remaining: + - '499998' + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e2a6eb640702-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:18:17 GMT + request-id: + - req_011Cg4xQiH6fP1ALowQUy2nJ + server: + - cloudflare + server-timing: + - x-originResponse;dur=298 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e2e89c1e0c69-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:18:27 GMT + request-id: + - req_011Cg4xRVBaVNbfvCjpVdmCY + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=127 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e328bed79113-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:18:37 GMT + request-id: + - req_011Cg4xSF1pDE1gSsseMqvSE + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=102 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e368a849aa71-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:18:47 GMT + request-id: + - req_011Cg4xSzj7NvVa6PbT9Yxat + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=126 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e3a92f41aacd-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:18:58 GMT + request-id: + - req_011Cg4xTmAp96px3RpYWQUww + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=213 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e3e9ca1e4b56-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:19:08 GMT + request-id: + - req_011Cg4xUX7zTvznC9bpbS2EM + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=93 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e429ba65aaf4-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:19:18 GMT + request-id: + - req_011Cg4xVGrH2uiyArkSte45m + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=123 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e469be985163-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:19:29 GMT + request-id: + - req_011Cg4xW2dJ445wgyCeCTWaG + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=108 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e4a9cadcaae5-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:19:39 GMT + request-id: + - req_011Cg4xWnT33ezaeYVuezT3W + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=157 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e4ea8a57ac75-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:19:49 GMT + request-id: + - req_011Cg4xXYkJYxcaBHtTywgnZ + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=115 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 0.48.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 0.48.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG + response: + body: + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2e52a7a2335ae-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:19:59 GMT + request-id: + - req_011Cg4xYJUqtKi5ZRkbYqH27 + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=145 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK - request: body: '' headers: @@ -37,10 +923,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches?limit=20 + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG response: body: - string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:20:09.136628+00:00","created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -49,23 +935,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b355ec5ed8d9-YYZ + - a4b2e56abc20ac57-YYZ connection: - keep-alive content-length: - - '9539' + - '470' content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:58 GMT + - Fri, 16 Oct 2026 00:20:10 GMT request-id: - - req_011Cg4uwr3Bgop4191Dasajr + - req_011Cg4xZ4QnVFPNakEfBU5WF server: - cloudflare server-timing: - - x-originResponse;dur=139 + - x-originResponse;dur=113 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -115,10 +1001,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG response: body: - string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + string: '{"id":"msgbatch_01UeR6U8emQcTKwcotaBF3AG","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:20:09.136628+00:00","created_at":"2026-10-16T00:18:17.083948+00:00","expires_at":"2026-10-17T00:18:17.083948+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -127,7 +1013,7 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b3577a890426-YYZ + - a4b2e56c4ac0aa9b-YYZ connection: - keep-alive content-length: @@ -137,13 +1023,13 @@ interactions: content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:59 GMT + - Fri, 16 Oct 2026 00:20:10 GMT request-id: - - req_011Cg4uwsDP5duxEdtLaEDc4 + - req_011Cg4xZ5Wm2NboQpVUgxHRt server: - cloudflare server-timing: - - x-originResponse;dur=133 + - x-originResponse;dur=175 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -193,12 +1079,16 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01UeR6U8emQcTKwcotaBF3AG/results response: body: - string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: - claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# - Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + string: '{"custom_id":"req-2","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4xTcLVavt94SJvzedfH","type":"message","role":"assistant","content":[{"type":"text","text":"3 + + 3 = 6"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + {"custom_id":"req-1","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4xTaV87gFkzXdytA1jU","type":"message","role":"assistant","content":[{"type":"text","text":"2 + + 2 = 4"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + ' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -207,23 +1097,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b35918540426-YYZ + - a4b2e56ddc54aa9b-YYZ connection: - keep-alive content-disposition: - - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + - attachment; filename*=utf-8''msgbatch_01UeR6U8emQcTKwcotaBF3AG_results.jsonl content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/x-jsonl date: - - Thu, 15 Oct 2026 23:45:59 GMT + - Fri, 16 Oct 2026 00:20:10 GMT request-id: - - req_011Cg4uwtL6YKkQYQAFsmmvs + - req_011Cg4xZ6ZWi6Te7nLMLCwqa server: - cloudflare server-timing: - - x-originResponse;dur=229 + - x-originResponse;dur=186 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml index 6c63a717d..3758b11ef 100644 --- a/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml +++ b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[async].yaml @@ -1,4 +1,1026 @@ interactions: +- request: + body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 2+2?"}]}},{"custom_id":"req-2","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 3+3?"}]}}]}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-length: + - '294' + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: POST + uri: https://api.anthropic.com/v1/messages/batches + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-ratelimit-batch-requests-limit: + - '500000' + anthropic-ratelimit-batch-requests-remaining: + - '499998' + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2db57ee48a253-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:13:17 GMT + request-id: + - req_011Cg4x2eM6JS2JGXFLEXKCn + server: + - cloudflare + server-timing: + - x-originResponse;dur=280 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2db9959e33a07-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:13:28 GMT + request-id: + - req_011Cg4x3R6trvXzeyAGSqw3F + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=147 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dbd97ddd3972-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:13:38 GMT + request-id: + - req_011Cg4x4Axd3pAwWV6deABFy + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=119 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dc197ac3a238-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:13:48 GMT + request-id: + - req_011Cg4x4vxXiywPgKWhyoB6T + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=174 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dc5a6d11175c-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:13:58 GMT + request-id: + - req_011Cg4x5hAbX19U7WosYU9XG + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=119 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dc9a8d6eabee-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:14:09 GMT + request-id: + - req_011Cg4x6T1aHborWuETr8qwA + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=217 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dcdb38baac48-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:14:19 GMT + request-id: + - req_011Cg4x7DGrjwEnp1mgRmCXn + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=112 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dd1baddeac75-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:14:29 GMT + request-id: + - req_011Cg4x7yLjZdbzn93yiAsUC + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=128 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dd5bafa439dd-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:14:40 GMT + request-id: + - req_011Cg4x8jHBL9ew3R2PghmJb + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=160 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dd9c0a6836b1-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:14:50 GMT + request-id: + - req_011Cg4x9VDruUBMh9o8CSySM + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=127 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dddc2d58bf5d-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:15:00 GMT + request-id: + - req_011Cg4xAEzNvXmyhK2n4CDoQ + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=106 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2de1bf83564a6-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:15:10 GMT + request-id: + - req_011Cg4xAzhvkbahnYRvVk2GE + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=137 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX + response: + body: + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2de5c9dd057af-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:15:21 GMT + request-id: + - req_011Cg4xBkuFBWHWzU55JWxMt + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=135 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK - request: body: '' headers: @@ -35,10 +1057,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches?limit=20 + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX response: body: - string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:15:25.682109+00:00","created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -47,23 +1069,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b32d5e247769-YYZ + - a4b2de9ccee2ebb6-YYZ connection: - keep-alive content-length: - - '9539' + - '470' content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:52 GMT + - Fri, 16 Oct 2026 00:15:31 GMT request-id: - - req_011Cg4uwNL4RHPByt5uzwLXa + - req_011Cg4xCWqS8NFfUCbDeQ3fQ server: - cloudflare server-timing: - - x-originResponse;dur=152 + - x-originResponse;dur=315 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -111,10 +1133,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX response: body: - string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + string: '{"id":"msgbatch_01AF5YeWL4wmeXjhitstM6pX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:15:25.682109+00:00","created_at":"2026-10-16T00:13:17.713690+00:00","expires_at":"2026-10-17T00:13:17.713690+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -123,7 +1145,7 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b32f388dea84-YYZ + - a4b2de9f8bc7aa55-YYZ connection: - keep-alive content-length: @@ -133,13 +1155,13 @@ interactions: content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:52 GMT + - Fri, 16 Oct 2026 00:15:31 GMT request-id: - - req_011Cg4uwPchiVeFQvPGDS8M8 + - req_011Cg4xCYfp2gR5Lr2ESng5p server: - cloudflare server-timing: - - x-originResponse;dur=162 + - x-originResponse;dur=126 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -187,12 +1209,16 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01AF5YeWL4wmeXjhitstM6pX/results response: body: - string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: - claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# - Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + string: '{"custom_id":"req-1","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4x4PhqVVe7Qi9Q8evyS","type":"message","role":"assistant","content":[{"type":"text","text":"2 + + 2 = 4"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + {"custom_id":"req-2","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4x4PTT9MDfu1Ve14Usb","type":"message","role":"assistant","content":[{"type":"text","text":"3 + + 3 = 6"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + ' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -201,23 +1227,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b3309c1eea84-YYZ + - a4b2dea0b808aa55-YYZ connection: - keep-alive content-disposition: - - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + - attachment; filename*=utf-8''msgbatch_01AF5YeWL4wmeXjhitstM6pX_results.jsonl content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/x-jsonl date: - - Thu, 15 Oct 2026 23:45:53 GMT + - Fri, 16 Oct 2026 00:15:32 GMT request-id: - - req_011Cg4uwQcjAofFdaXgqg4BT + - req_011Cg4xCZVRmRXNyERgb3oPj server: - cloudflare server-timing: - - x-originResponse;dur=243 + - x-originResponse;dur=237 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: diff --git a/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml index c15b028e5..e573286b8 100644 --- a/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml +++ b/py/src/braintrust/integrations/anthropic/cassettes/latest/TestBatchesResultsSpans.test_batches_results_produces_span[sync].yaml @@ -1,4 +1,870 @@ interactions: +- request: + body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 2+2?"}]}},{"custom_id":"req-2","params":{"model":"claude-haiku-4-5-20251001","max_tokens":100,"messages":[{"role":"user","content":"What + is 3+3?"}]}}]}' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + content-length: + - '294' + content-type: + - application/json + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: POST + uri: https://api.anthropic.com/v1/messages/batches + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-ratelimit-batch-requests-limit: + - '500000' + anthropic-ratelimit-batch-requests-remaining: + - '499998' + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2d8907dc0ac33-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:11:23 GMT + request-id: + - req_011Cg4wtFgMe6CS2YrbUvD7H + server: + - cloudflare + server-timing: + - x-originResponse;dur=275 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2d8d1dfcbc4c7-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:11:34 GMT + request-id: + - req_011Cg4wu2RutiniuuMDQM7oK + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=138 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2d9121d9aabfd-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:11:44 GMT + request-id: + - req_011Cg4wunMc61WqLmGesP8fU + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=115 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2d9522de8a21c-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:11:54 GMT + request-id: + - req_011Cg4wvY7dGzXoPnXSzHYH8 + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=118 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2d9921c35ac6c-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:12:04 GMT + request-id: + - req_011Cg4wwHtQBU3PCkoTfaJ7E + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=129 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2d9d21c2daaee-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:12:15 GMT + request-id: + - req_011Cg4wx3jdCUMSBY86y6gJx + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=158 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2da12dbdaaa71-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:12:25 GMT + request-id: + - req_011Cg4wxoyRa1Bu9fNFBVggV + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=123 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2da52ddbce5b3-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:12:35 GMT + request-id: + - req_011Cg4wyZjwdELbc886pN8Cg + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=123 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2da9339dbe702-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:12:46 GMT + request-id: + - req_011Cg4wzKnLPLstjQ7frMVfh + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=105 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2dad309b3375a-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:12:56 GMT + request-id: + - req_011Cg4x15UdkwdymCSXf8DdV + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=119 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK +- request: + body: '' + headers: + accept: + - application/json + accept-encoding: + - gzip, deflate, zstd + anthropic-version: + - '2023-06-01' + connection: + - keep-alive + host: + - api.anthropic.com + user-agent: + - Anthropic/Python 1.13.0 + x-stainless-arch: + - arm64 + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - MacOS + x-stainless-package-version: + - 1.13.0 + x-stainless-read-timeout: + - '600' + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.14.7 + x-stainless-timeout: + - NOT_GIVEN + method: GET + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw + response: + body: + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}' + headers: + anthropic-organization-id: + - 27796668-7351-40ac-acc4-024aee8995a5 + anthropic-workspace-id: + - wrkspc_018bFG1FgNVWqx5pthtdGTzS + cf-cache-status: + - DYNAMIC + cf-ray: + - a4b2db130fa0ddfa-YYZ + connection: + - keep-alive + content-length: + - '361' + content-security-policy: + - default-src 'none'; frame-ancestors 'none' + content-type: + - application/json + date: + - Fri, 16 Oct 2026 00:13:06 GMT + request-id: + - req_011Cg4x1qDREpi52KbHpZFxG + retry-after: + - '10' + server: + - cloudflare + server-timing: + - x-originResponse;dur=130 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-robots-tag: + - none + status: + code: 200 + message: OK - request: body: '' headers: @@ -35,10 +901,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches?limit=20 + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw response: body: - string: '{"data":[{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"},{"id":"msgbatch_01KzeShw7Gj5agoUTAX1Vot1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:21.254145+00:00","created_at":"2026-10-13T14:13:02.931761+00:00","expires_at":"2026-10-14T14:13:02.931761+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01KzeShw7Gj5agoUTAX1Vot1/results"},{"id":"msgbatch_01NcX8qVZkngRf91bmqLT2Di","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:15:24.517255+00:00","created_at":"2026-10-13T14:13:02.383039+00:00","expires_at":"2026-10-14T14:13:02.383039+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01NcX8qVZkngRf91bmqLT2Di/results"},{"id":"msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.597173+00:00","created_at":"2026-10-13T14:13:01.791614+00:00","expires_at":"2026-10-14T14:13:01.791614+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_013Wmi7D8aWqoQQYhU7Ytgkp/results"},{"id":"msgbatch_0169YCB226H2M463dzjYN6M1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:12.437619+00:00","created_at":"2026-10-13T14:13:01.100268+00:00","expires_at":"2026-10-14T14:13:01.100268+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_0169YCB226H2M463dzjYN6M1/results"},{"id":"msgbatch_01RsUoV7kbBRRLfni75RsWwi","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.806341+00:00","created_at":"2026-10-05T14:46:14.859457+00:00","expires_at":"2026-10-06T14:46:14.859457+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01RsUoV7kbBRRLfni75RsWwi/results"},{"id":"msgbatch_01JzZDAwU8KcBffqmbEARDsC","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.770064+00:00","created_at":"2026-10-05T14:46:14.334977+00:00","expires_at":"2026-10-06T14:46:14.334977+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JzZDAwU8KcBffqmbEARDsC/results"},{"id":"msgbatch_01MgMy3YBXJzLACzkXHPAZ6f","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:15.606253+00:00","created_at":"2026-10-05T14:46:13.834387+00:00","expires_at":"2026-10-06T14:46:13.834387+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MgMy3YBXJzLACzkXHPAZ6f/results"},{"id":"msgbatch_01JaWuVexbG4wJCF3iro6KZu","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:11.603223+00:00","created_at":"2026-10-05T14:46:13.138721+00:00","expires_at":"2026-10-06T14:46:13.138721+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01JaWuVexbG4wJCF3iro6KZu/results"},{"id":"msgbatch_019i144JfYnpw7oPiVX2S5de","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-05T14:49:16.553792+00:00","created_at":"2026-10-05T14:46:12.633772+00:00","expires_at":"2026-10-06T14:46:12.633772+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_019i144JfYnpw7oPiVX2S5de/results"},{"id":"msgbatch_01M4EWsdQs76sxKkG4zSjvqc","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:08.329624+00:00","created_at":"2026-09-28T18:58:03.418159+00:00","expires_at":"2026-09-29T18:58:03.418159+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01M4EWsdQs76sxKkG4zSjvqc/results"},{"id":"msgbatch_01E8u6bka33UNmw9FweyixXK","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:05.256400+00:00","created_at":"2026-09-28T18:58:02.996709+00:00","expires_at":"2026-09-29T18:58:02.996709+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01E8u6bka33UNmw9FweyixXK/results"},{"id":"msgbatch_01Rq2zeeXyruQCG1hnLwEyY6","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.401982+00:00","created_at":"2026-09-28T18:58:02.495926+00:00","expires_at":"2026-09-29T18:58:02.495926+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Rq2zeeXyruQCG1hnLwEyY6/results"},{"id":"msgbatch_01C88UZkTz6HvkqWTyHoyPv1","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:01.130785+00:00","created_at":"2026-09-28T18:58:01.679487+00:00","expires_at":"2026-09-29T18:58:01.679487+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01C88UZkTz6HvkqWTyHoyPv1/results"},{"id":"msgbatch_01MeELNBVJ5KA8qmB1NjL6UX","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-28T19:01:00.544788+00:00","created_at":"2026-09-28T18:58:01.180445+00:00","expires_at":"2026-09-29T18:58:01.180445+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01MeELNBVJ5KA8qmB1NjL6UX/results"},{"id":"msgbatch_01Spq1x8wEydiAfMwWjg58Sz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.611229+00:00","created_at":"2026-09-22T14:46:06.900407+00:00","expires_at":"2026-09-23T14:46:06.900407+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01Spq1x8wEydiAfMwWjg58Sz/results"},{"id":"msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:39.499024+00:00","created_at":"2026-09-22T14:46:06.560933+00:00","expires_at":"2026-09-23T14:46:06.560933+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01TmSLWF6cuv3Zn7cnWt82Nz/results"},{"id":"msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:53.287767+00:00","created_at":"2026-09-22T14:46:06.123258+00:00","expires_at":"2026-09-23T14:46:06.123258+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01EW6PbW5GYjaQ1JYVzgUGvs/results"},{"id":"msgbatch_01XEoQtbFiFSSeGdksGJy8ym","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:42.894349+00:00","created_at":"2026-09-22T14:46:04.999953+00:00","expires_at":"2026-09-23T14:46:04.999953+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01XEoQtbFiFSSeGdksGJy8ym/results"},{"id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-09-22T14:48:54.277668+00:00","created_at":"2026-09-22T14:46:04.686187+00:00","expires_at":"2026-09-23T14:46:04.686187+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01HAiGquZZbJdXWg2X26gvFn/results"}],"has_more":true,"first_id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","last_id":"msgbatch_01HAiGquZZbJdXWg2X26gvFn"}' + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:13:09.106412+00:00","created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -47,23 +913,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b3280bdaa234-YYZ + - a4b2db532fb2ab04-YYZ connection: - keep-alive content-length: - - '9539' + - '470' content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:51 GMT + - Fri, 16 Oct 2026 00:13:16 GMT request-id: - - req_011Cg4uwJkWLkcxfiz6eBdRX + - req_011Cg4x2b68sogvHzYkxbVAB server: - cloudflare server-timing: - - x-originResponse;dur=206 + - x-originResponse;dur=116 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -111,10 +977,10 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw response: body: - string: '{"id":"msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":1,"errored":1,"canceled":0,"expired":0},"ended_at":"2026-10-13T14:14:11.936150+00:00","created_at":"2026-10-13T14:13:04.327686+00:00","expires_at":"2026-10-14T14:13:04.327686+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results"}' + string: '{"id":"msgbatch_012k3jW1JwstfHLL8QzvHfSw","type":"message_batch","processing_status":"ended","request_counts":{"processing":0,"succeeded":2,"errored":0,"canceled":0,"expired":0},"ended_at":"2026-10-16T00:13:09.106412+00:00","created_at":"2026-10-16T00:11:23.867612+00:00","expires_at":"2026-10-17T00:11:23.867612+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":"https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw/results"}' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -123,7 +989,7 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b32a1a30aacd-YYZ + - a4b2db54bce2ac15-YYZ connection: - keep-alive content-length: @@ -133,13 +999,13 @@ interactions: content-type: - application/json date: - - Thu, 15 Oct 2026 23:45:51 GMT + - Fri, 16 Oct 2026 00:13:17 GMT request-id: - - req_011Cg4uwL8MCz55MERtkRFG9 + - req_011Cg4x2c8PjEV51mCpq6ePg server: - cloudflare server-timing: - - x-originResponse;dur=101 + - x-originResponse;dur=100 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -187,12 +1053,16 @@ interactions: x-stainless-timeout: - NOT_GIVEN method: GET - uri: https://api.anthropic.com/v1/messages/batches/msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb/results + uri: https://api.anthropic.com/v1/messages/batches/msgbatch_012k3jW1JwstfHLL8QzvHfSw/results response: body: - string: "{\"custom_id\":\"req-2\",\"result\":{\"type\":\"errored\",\"error\":{\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"not_found_error\",\"message\":\"model: - claude-3-5-haiku-latest\"},\"request_id\":null}}}\n{\"custom_id\":\"req-1\",\"result\":{\"type\":\"succeeded\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_011CfzNg2nH624Un8D5VxjZh\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"# - Hello! \U0001F44B\\n\\nHow can I help you today?\"}],\"container\":null,\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"stop_details\":null,\"usage\":{\"input_tokens\":8,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"batch\",\"inference_geo\":\"not_available\"},\"diagnostics\":null}}}\n" + string: '{"custom_id":"req-1","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4wubTX25auKkqGK7rz9","type":"message","role":"assistant","content":[{"type":"text","text":"2 + + 2 = 4"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + {"custom_id":"req-2","result":{"type":"succeeded","message":{"model":"claude-haiku-4-5-20251001","id":"msg_011Cg4wuYKWG4fKufiyiuLjQ","type":"message","role":"assistant","content":[{"type":"text","text":"3 + + 3 = 6"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":14,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":13,"service_tier":"batch","inference_geo":"not_available","speed":"standard"},"diagnostics":null}}} + + ' headers: anthropic-organization-id: - 27796668-7351-40ac-acc4-024aee8995a5 @@ -201,23 +1071,23 @@ interactions: cf-cache-status: - DYNAMIC cf-ray: - - a4b2b32b2b17aacd-YYZ + - a4b2db55be01ac15-YYZ connection: - keep-alive content-disposition: - - attachment; filename*=utf-8''msgbatch_01L3D4bE1Az6hx1ncR3Rnrtb_results.jsonl + - attachment; filename*=utf-8''msgbatch_012k3jW1JwstfHLL8QzvHfSw_results.jsonl content-security-policy: - default-src 'none'; frame-ancestors 'none' content-type: - application/x-jsonl date: - - Thu, 15 Oct 2026 23:45:52 GMT + - Fri, 16 Oct 2026 00:13:17 GMT request-id: - - req_011Cg4uwLrG1KPT3U1EhjuUR + - req_011Cg4x2cr488hptmpdHYj9h server: - cloudflare server-timing: - - x-originResponse;dur=212 + - x-originResponse;dur=215 strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: diff --git a/py/src/braintrust/integrations/anthropic/test_anthropic.py b/py/src/braintrust/integrations/anthropic/test_anthropic.py index cfa35dc47..588a5c5e5 100644 --- a/py/src/braintrust/integrations/anthropic/test_anthropic.py +++ b/py/src/braintrust/integrations/anthropic/test_anthropic.py @@ -1563,12 +1563,12 @@ def test_auto_instrument_anthropic(self): verify_autoinstrument_script("test_auto_anthropic.py") -def _make_batch_requests(): +def _make_batch_requests(model=MODEL): return [ { "custom_id": "req-1", "params": { - "model": MODEL, + "model": model, "max_tokens": 100, "messages": [{"role": "user", "content": "What is 2+2?"}], }, @@ -1576,7 +1576,7 @@ def _make_batch_requests(): { "custom_id": "req-2", "params": { - "model": MODEL, + "model": model, "max_tokens": 100, "messages": [{"role": "user", "content": "What is 3+3?"}], }, @@ -1677,9 +1677,9 @@ def test_sync_batches_create_multi_model_metadata(self, memory_logger): class TestBatchesResultsSpans: """Tests verifying that batches.results() produces correct spans. - Batches can take up to 24 hours to finish, so the success test reads the - results of an already-ended batch (such as one left by TestBatchesCreateSpans) - instead of creating one. + The success test creates its own small batch and polls until it ends, so the + cassette only ever contains this suite's requests. Small batches usually end + within a few minutes; polls only sleep while recording. """ @pytest.mark.vcr @@ -1687,14 +1687,20 @@ class TestBatchesResultsSpans: # The sync case passes the batch id positionally and the async case by keyword, # covering both argument-extraction paths. @pytest.mark.parametrize("is_async,positional", [(False, True), (True, False)], ids=["sync", "async"]) - async def test_batches_results_produces_span(self, memory_logger, is_async, positional): - assert not memory_logger.pop() + async def test_batches_results_produces_span(self, memory_logger, vcr_cassette, is_async, positional): + raw_client = _get_client() + # On older SDK versions MODEL is the retired LEGACY_MODEL, whose batch requests now error. + batch = raw_client.messages.batches.create(requests=_make_batch_requests(LATEST_MODEL)) + deadline = time.time() + 15 * 60 + while batch.processing_status != "ended": + assert time.time() < deadline, f"batch {batch.id} did not end within 15 minutes" + if not vcr_cassette.write_protected: + time.sleep(10) + batch = raw_client.messages.batches.retrieve(batch.id) + batch_id = batch.id + # Drop setup spans: test_setup_creates_spans may have auto-instrumented the raw client. + memory_logger.pop() - batch_id = next( - b.id - for b in _get_client().messages.batches.list(limit=20).data - if b.processing_status == "ended" and b.request_counts.succeeded - ) client = wrap_anthropic(_get_async_client() if is_async else _get_client()) if positional: result = client.messages.batches.results(batch_id) @@ -1706,6 +1712,7 @@ async def test_batches_results_produces_span(self, memory_logger, is_async, posi else: entries = list(result) + assert {entry.custom_id for entry in entries} == {"req-1", "req-2"} assert any(entry.result.type == "succeeded" for entry in entries) spans = memory_logger.pop()