The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
{
"resourceSpans": [
{
"resource": {
"attributes": [
{
"key": "gen_ai.agent.name",
"value": {
"stringValue": "research_agent"
}
},
{
"key": "host.arch",
"value": {
"stringValue": "arm64"
}
},
{
"key": "os.type",
"value": {
"stringValue": "darwin"
}
},
{
"key": "os.version",
"value": {
"stringValue": "25.6.0"
}
},
{
"key": "service.name",
"value": {
"stringValue": "claude-code"
}
},
{
"key": "service.version",
"value": {
"stringValue": "2.1.286"
}
}
]
},
"scopeSpans": [
{
"scope": {
"name": "com.anthropic.claude_code.tracing",
"version": "1.0.0"
},
"spans": [
{
"traceId": "207bf859f653150fd4346add5cb11ad3",
"spanId": "1825d4fb63cffcec",
"parentSpanId": "8a420dd58d6ff237",
"name": "claude_code.llm_request",
"kind": 1,
"startTimeUnixNano": "1791061376589000000",
"endTimeUnixNano": "1791061384361645125",
"attributes": [
{
"key": "gen_ai.agent.name",
"value": {
"stringValue": "research_agent"
}
},
{
"key": "user.id",
"value": {
"stringValue": "999dc5afd40b65ac74b33bdc01c83510d935a57dfc4b1c232b51504bb8caed2e"
}
},
{
"key": "session.id",
"value": {
"stringValue": "0e5bb47c-6b08-4a1b-bde4-9ab142589572"
}
},
{
"key": "terminal.type",
"value": {
"stringValue": "ghostty"
}
},
{
"key": "span.type",
"value": {
"stringValue": "llm_request"
}
},
{
"key": "model",
"value": {
"stringValue": "openai/gpt-6-luna"
}
},
{
"key": "gen_ai.system",
"value": {
"stringValue": "anthropic"
}
},
{
"key": "gen_ai.request.model",
"value": {
"stringValue": "openai/gpt-6-luna"
}
},
{
"key": "llm_request.context",
"value": {
"stringValue": "interaction"
}
},
{
"key": "speed",
"value": {
"stringValue": "normal"
}
},
{
"key": "query_source",
"value": {
"stringValue": "sdk"
}
},
{
"key": "query_source_safe",
"value": {
"stringValue": "sdk"
}
},
{
"key": "system_prompt_hash",
"value": {
"stringValue": "sp_900a80ee886b"
}
},
{
"key": "system_prompt_preview",
"value": {
"stringValue": "x-anthropic-billing-header: cc_version=2.1.286.bd3; cc_entrypoint=sdk-py;\n\nYou are a Claude agent, built on Anthropic's Claude Agent SDK."
}
},
{
"key": "system_prompt_length",
"value": {
"intValue": "137"
}
},
{
"key": "tools",
"value": {
"stringValue": "[]"
}
},
{
"key": "tools_count",
"value": {
"intValue": "0"
}
},
{
"key": "new_context_message_count",
"value": {
"intValue": "2"
}
},
{
"key": "system_reminders_count",
"value": {
"intValue": "2"
}
},
{
"key": "new_context",
"value": {
"stringValue": "[USER]\nWhat is an agent trace?"
}
},
{
"key": "system_reminders",
"value": {
"stringValue": "Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.\n\nContents of /home/user/.claude/projects/-home-user-dev-litellm-lens-example/memory/MEMORY.md (user's auto-memory, persists across conversations):\n\n- [LiteLLM spend correlation contract](litellm-spend-correlation-contract.md) \u2014 source PR #44421, offline validation with mock gateway + recorder\n- [SDK wiring limits](litellm-lens-example-sdk-wiring-limits.md) \u2014 which SDKs cannot take the shared gateway transport and why\n\n---\n\n# Environment\nYou have been invoked in the following environment: \n - Primary working directory: /home/user/dev/litellm-lens-example/claude-agent-sdk\n - Is a git repository: true\n - Platform: darwin\n - Shell: zsh\n - OS Version: Darwin 25.6.0\n\nYou are powered by the model openai/gpt-6-luna.\n\n<total_tokens>15000000 tokens left</total_tokens>\n\nToday's date is 2026-10-03."
}
},
{
"key": "duration_ms",
"value": {
"intValue": "7772"
}
},
{
"key": "input_tokens",
"value": {
"intValue": "323"
}
},
{
"key": "output_tokens",
"value": {
"intValue": "671"
}
},
{
"key": "cache_read_tokens",
"value": {
"intValue": "0"
}
},
{
"key": "cache_creation_tokens",
"value": {
"intValue": "0"
}
},
{
"key": "success",
"value": {
"boolValue": true
}
},
{
"key": "attempt",
"value": {
"intValue": "1"
}
},
{
"key": "response.has_tool_call",
"value": {
"boolValue": false
}
},
{
"key": "request_id",
"value": {
"stringValue": "msg_b65eb4b6-da48-4eb3-a564-0f65202f4797"
}
},
{
"key": "gen_ai.response.id",
"value": {
"stringValue": "msg_b65eb4b6-da48-4eb3-a564-0f65202f4797"
}
},
{
"key": "ttft_ms",
"value": {
"intValue": "769"
}
},
{
"key": "first_content_ms",
"value": {
"intValue": "6113"
}
},
{
"key": "effort",
"value": {
"stringValue": "high"
}
},
{
"key": "response.model_output",
"value": {
"stringValue": "An **agent trace** is the connected record of one agent task from start to finish\u2014not just a single LLM request.\n\nFor example, a task might produce a trace containing:\n1. The agent\u2019s model call\n2. A weather-tool call and its result\n3. A follow-up model call that writes the answer\n\nThose steps are linked as spans in a timeline, often with timestamps, status, token usage, and cost. Traces help you understand what the agent did, where it failed or spent time, and which calls contributed to the cost.\n\nA trace may contain prompts and tool inputs or outputs, depending on the instrumentation, but it **doesn\u2019t mean the agent\u2019s hidden chain-of-thought is being recorded**."
}
},
{
"key": "stop_reason",
"value": {
"stringValue": "end_turn"
}
},
{
"key": "gen_ai.response.finish_reasons",
"value": {
"arrayValue": {
"values": [
{
"stringValue": "end_turn"
}
]
}
}
}
],
"events": [
{
"timeUnixNano": "1791061376591988250",
"name": "gen_ai.request.attempt",
"attributes": [
{
"key": "attempt",
"value": {
"intValue": "1"
}
}
]
}
],
"status": {},
"flags": 257
},
{
"traceId": "207bf859f653150fd4346add5cb11ad3",
"spanId": "8a420dd58d6ff237",
"parentSpanId": "c2c6b0971076f31c",
"name": "claude_code.interaction",
"kind": 1,
"startTimeUnixNano": "1791061376541000000",
"endTimeUnixNano": "1791061384366705375",
"attributes": [
{
"key": "gen_ai.agent.name",
"value": {
"stringValue": "research_agent"
}
},
{
"key": "user.id",
"value": {
"stringValue": "999dc5afd40b65ac74b33bdc01c83510d935a57dfc4b1c232b51504bb8caed2e"
}
},
{
"key": "session.id",
"value": {
"stringValue": "0e5bb47c-6b08-4a1b-bde4-9ab142589572"
}
},
{
"key": "terminal.type",
"value": {
"stringValue": "ghostty"
}
},
{
"key": "span.type",
"value": {
"stringValue": "interaction"
}
},
{
"key": "user_prompt",
"value": {
"stringValue": "What is an agent trace?"
}
},
{
"key": "user_prompt_length",
"value": {
"intValue": "23"
}
},
{
"key": "interaction.sequence",
"value": {
"intValue": "1"
}
},
{
"key": "parent.source",
"value": {
"stringValue": "env"
}
},
{
"key": "queued_sends",
"value": {
"intValue": "0"
}
},
{
"key": "new_context",
"value": {
"stringValue": "[USER PROMPT]\nWhat is an agent trace?"
}
},
{
"key": "interaction.duration_ms",
"value": {
"intValue": "7826"
}
}
],
"status": {},
"flags": 769
}
]
}
]
},
{
"resource": {
"attributes": [
{
"key": "telemetry.sdk.language",
"value": {
"stringValue": "python"
}
},
{
"key": "telemetry.sdk.name",
"value": {
"stringValue": "opentelemetry"
}
},
{
"key": "telemetry.sdk.version",
"value": {
"stringValue": "1.45.0"
}
},
{
"key": "service.instance.id",
"value": {
"stringValue": "5ac3598e-aed9-4cda-ac0e-1ab2f82a2673"
}
},
{
"key": "gen_ai.agent.name",
"value": {
"stringValue": "research_agent"
}
},
{
"key": "telemetry.auto.version",
"value": {
"stringValue": "0.66b0"
}
},
{
"key": "service.name",
"value": {
"stringValue": "unknown_service:python3"
}
}
]
},
"scopeSpans": [
{
"scope": {
"name": "openinference.instrumentation.claude_agent_sdk",
"version": "0.1.20"
},
"spans": [
{
"traceId": "207bf859f653150fd4346add5cb11ad3",
"spanId": "c2c6b0971076f31c",
"name": "ClaudeAgentSDK.query",
"kind": 1,
"startTimeUnixNano": "1791061376098056000",
"endTimeUnixNano": "1791061384413648000",
"attributes": [
{
"key": "llm.system",
"value": {
"stringValue": "anthropic"
}
},
{
"key": "llm.provider",
"value": {
"stringValue": "anthropic"
}
},
{
"key": "input.value",
"value": {
"stringValue": "What is an agent trace?"
}
},
{
"key": "input.mime_type",
"value": {
"stringValue": "text/plain"
}
},
{
"key": "llm.output_messages.0.message.content.0",
"value": {
"stringValue": "An **agent trace** is the connected record of one agent task from start to finish\u2014not just a single LLM request.\n\nFor example, a task might produce a trace containing:\n1. The agent\u2019s model call\n2. A weather-tool call and its result\n3. A follow-up model call that writes the answer\n\nThose steps are linked as spans in a timeline, often with timestamps, status, token usage, and cost. Traces help you understand what the agent did, where it failed or spent time, and which calls contributed to the cost.\n\nA trace may contain prompts and tool inputs or outputs, depending on the instrumentation, but it **doesn\u2019t mean the agent\u2019s hidden chain-of-thought is being recorded**."
}
},
{
"key": "llm.output_messages.0.message.role",
"value": {
"stringValue": "assistant"
}
},
{
"key": "llm.finish_reason",
"value": {
"stringValue": "end_turn"
}
},
{
"key": "output.value",
"value": {
"stringValue": "An **agent trace** is the connected record of one agent task from start to finish\u2014not just a single LLM request.\n\nFor example, a task might produce a trace containing:\n1. The agent\u2019s model call\n2. A weather-tool call and its result\n3. A follow-up model call that writes the answer\n\nThose steps are linked as spans in a timeline, often with timestamps, status, token usage, and cost. Traces help you understand what the agent did, where it failed or spent time, and which calls contributed to the cost.\n\nA trace may contain prompts and tool inputs or outputs, depending on the instrumentation, but it **doesn\u2019t mean the agent\u2019s hidden chain-of-thought is being recorded**."
}
},
{
"key": "output.mime_type",
"value": {
"stringValue": "text/plain"
}
},
{
"key": "llm.model_name",
"value": {
"stringValue": "openai/gpt-6-luna"
}
},
{
"key": "llm.token_count.prompt",
"value": {
"intValue": "323"
}
},
{
"key": "llm.token_count.completion",
"value": {
"intValue": "671"
}
},
{
"key": "llm.token_count.total",
"value": {
"intValue": "994"
}
},
{
"key": "llm.token_count.prompt_details.cache_read",
"value": {
"intValue": "0"
}
},
{
"key": "llm.token_count.prompt_details.cache_write",
"value": {
"intValue": "0"
}
},
{
"key": "llm.cost.total",
"value": {
"doubleValue": 0.014712000000000001
}
},
{
"key": "session.id",
"value": {
"stringValue": "0e5bb47c-6b08-4a1b-bde4-9ab142589572"
}
},
{
"key": "openinference.span.kind",
"value": {
"stringValue": "AGENT"
}
}
],
"status": {
"code": 1
},
"flags": 256
}
]
}
]
}
]
}