Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

6.2 KB
Raw Blame
interactions:
- request:
    body: '{"max_tokens": 1024, "messages": [{"role": "user", "content": "Write a
      short greeting."}], "model": "claude-3-5-sonnet-latest", "system": "You are
      a helpful assistant."}'
    headers:
      accept:
      - application/json
      accept-encoding:
      - gzip, deflate
      anthropic-version:
      - REDACTED
      connection:
      - keep-alive
      content-length:
      - '169'
      content-type:
      - application/json
      host:
      - api.anthropic.com
      user-agent:
      - Anthropic/Python 0.43.0
      x-api-key:
      - REDACTED
      x-stainless-arch:
      - REDACTED
      x-stainless-async:
      - REDACTED
      x-stainless-lang:
      - REDACTED
      x-stainless-os:
      - REDACTED
      x-stainless-package-version:
      - 0.43.0
      x-stainless-retry-count:
      - '0'
      x-stainless-runtime:
      - REDACTED
      x-stainless-runtime-version:
      - REDACTED
    method: POST
    uri: https://api.anthropic.com/v1/messages
  response:
    body:
      string: '{"id":"msg_01FuxB6Gq5QdsdPdafGVavMe","type":"message","role":"assistant","model":"claude-3-5-sonnet-20241022","content":[{"type":"text","text":"Hi
        there! How are you today?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":18,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11}}'
    headers:
      CF-Cache-Status:
      - DYNAMIC
      CF-RAY: REDACTED
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Tue, 14 Jan 2025 22:01:32 GMT
      Server:
      - cloudflare
      Transfer-Encoding:
      - chunked
      X-Robots-Tag:
      - none
      anthropic-ratelimit-input-tokens-limit:
      - '400000'
      anthropic-ratelimit-input-tokens-remaining:
      - '400000'
      anthropic-ratelimit-input-tokens-reset:
      - '2025-01-14T22:01:32Z'
      anthropic-ratelimit-output-tokens-limit:
      - '80000'
      anthropic-ratelimit-output-tokens-remaining:
      - '80000'
      anthropic-ratelimit-output-tokens-reset:
      - '2025-01-14T22:01:32Z'
      anthropic-ratelimit-requests-limit:
      - '4000'
      anthropic-ratelimit-requests-remaining:
      - '3999'
      anthropic-ratelimit-requests-reset:
      - '2025-01-14T22:01:31Z'
      anthropic-ratelimit-tokens-limit:
      - '480000'
      anthropic-ratelimit-tokens-remaining:
      - '480000'
      anthropic-ratelimit-tokens-reset:
      - '2025-01-14T22:01:32Z'
      content-length:
      - '329'
      request-id:
      - req_011Ar8gjbPNQwhNBvQQY5ZcC
      via:
      - 1.1 google
    status:
      code: 200
      message: OK
- request:
    body: '{"max_tokens": 1024, "messages": [{"role": "user", "content": "Write a
      short greeting."}], "model": "claude-3-5-sonnet-latest", "stream": true}'
    headers:
      accept:
      - application/json
      accept-encoding:
      - gzip, deflate
      anthropic-version:
      - REDACTED
      connection:
      - keep-alive
      content-length:
      - '143'
      content-type:
      - application/json
      host:
      - api.anthropic.com
      user-agent:
      - Anthropic/Python 0.43.0
      x-api-key:
      - REDACTED
      x-stainless-arch:
      - REDACTED
      x-stainless-async:
      - REDACTED
      x-stainless-lang:
      - REDACTED
      x-stainless-os:
      - REDACTED
      x-stainless-package-version:
      - 0.43.0
      x-stainless-retry-count:
      - '0'
      x-stainless-runtime:
      - REDACTED
      x-stainless-runtime-version:
      - REDACTED
    method: POST
    uri: https://api.anthropic.com/v1/messages
  response:
    body:
      string: 'event: message_start

        data: {"type":"message_start","message":{"id":"msg_01KoEzb5DsZ7cLWaVCKnxBA7","type":"message","role":"assistant","model":"claude-3-5-sonnet-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":12,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":1}}            }


        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":"Hi"}       }


        event: content_block_delta

        data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"
        there! How are you today"}         }


        event: content_block_delta

        data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"?"}           }


        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":11}  }


        event: message_stop

        data: {"type":"message_stop"             }


        '
    headers:
      CF-Cache-Status:
      - DYNAMIC
      CF-RAY: REDACTED
      Cache-Control:
      - no-cache
      Connection:
      - keep-alive
      Content-Type:
      - text/event-stream; charset=utf-8
      Date:
      - Tue, 14 Jan 2025 22:01:32 GMT
      Server:
      - cloudflare
      Transfer-Encoding:
      - chunked
      X-Robots-Tag:
      - none
      anthropic-ratelimit-input-tokens-limit:
      - '400000'
      anthropic-ratelimit-input-tokens-remaining:
      - '400000'
      anthropic-ratelimit-input-tokens-reset:
      - '2025-01-14T22:01:32Z'
      anthropic-ratelimit-output-tokens-limit:
      - '80000'
      anthropic-ratelimit-output-tokens-remaining:
      - '79000'
      anthropic-ratelimit-output-tokens-reset:
      - '2025-01-14T22:01:33Z'
      anthropic-ratelimit-requests-limit:
      - '4000'
      anthropic-ratelimit-requests-remaining:
      - '3999'
      anthropic-ratelimit-requests-reset:
      - '2025-01-14T22:01:32Z'
      anthropic-ratelimit-tokens-limit:
      - '480000'
      anthropic-ratelimit-tokens-remaining:
      - '479000'
      anthropic-ratelimit-tokens-reset:
      - '2025-01-14T22:01:32Z'
      request-id:
      - req_01BJY5zW9vj8SeRTfFgxKNjX
      via:
      - 1.1 google
    status:
      code: 200
      message: OK
version: 1