type: user

role: user

content: <local-command-caveat>Caveat: The messages below were generated by the user while running local commands. DO NOT respond to these messages or otherwise consider them in your response unless the user explicitly asks you to.</local-command-caveat>

userType: external

entrypoint: cli

gitBranch: HEAD


content:
<command-name>/context</command-name>
            <command-message>context</command-message>
            <command-args></command-args>


content:
<local-command-stdout> Context Usage
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛶   claude-sonnet-4-6 · 15k/200k tokens (7%)

⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   Estimated usage by category
                      ⛁ System prompt: 6.1k tokens (3.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 8.2k tokens (4.1%)
                      ⛁ Skills: 476 tokens (0.2%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
                      ⛶ Free space: 152k (76.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛝ Autocompact buffer: 33k tokens (16.5%)

⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝

⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝

MCP tools · /mcp (loaded on-demand)

Available
└ mcp__context7__query-docs
└ mcp__context7__resolve-library-id
└ mcp__ide__executeCode
└ mcp__ide__getDiagnostics

Skills · /skills</local-command-stdout>


content: use context7 to summarize for me the right way to use OpenAI Agents SDK with a model other than OpenAI's models

permissionMode: default


type: message

role: assistant

type: thinking

service_tier: standard

type: assistant


Agent

description: Fetch OpenAI Agents SDK custom model docs

prompt:
Use context7 to find documentation about using the OpenAI Agents SDK with non-OpenAI models (custom models, alternative providers, LiteLLM, etc.).

Steps:
1. Use mcp__context7__resolve-library-id to find the OpenAI Agents SDK library ID
2. Use mcp__context7__query-docs to fetch docs about using custom/alternative model providers

Return the full relevant content about how to configure and use non-OpenAI models with the Agents SDK.

type: direct

speed: standard


type: text

text:
I need to request permission to use WebSearch to find the current OpenAI Agents SDK documentation. You have WebSearch blocked in "don't ask mode" in your configuration.

To help you find documentation about using the OpenAI Agents SDK with non-OpenAI models, I can:

1. **Enable WebSearch permission** - This would let me search for the latest OpenAI Agents SDK docs about alternative model providers
2. **Use the context7 MCP server directly** - But this requires calling it through Claude Code's native MCP integration, which I can describe how to do

However, I should note an important clarification: The **OpenAI Agents SDK** is specifically designed for OpenAI models and typically doesn't have built-in support for non-OpenAI models like Anthropic Claude or LiteLLM providers.

If you're looking to:
- **Use Claude models with an agents framework** → Consider the **Claude Agent SDK** (built on Anthropic's Claude API)
- **Use OpenAI models** → The OpenAI Agents SDK is the right choice
- **Use multiple model providers** → LiteLLM provides a unified interface but you'd need to integrate it yourself

Would you like me to:
1. Request WebSearch permission to find current OpenAI Agents SDK documentation?
2. Fetch documentation about the **Claude Agent SDK** instead (which is designed for Anthropic's Claude models)?
3. Search for information about wrapping alternative models with the OpenAI Agents SDK?

Let me know how you'd like to proceed!

text:
agentId: a77b88adcd93004bf (use SendMessage with to: 'a77b88adcd93004bf' to continue this agent)
<usage>total_tokens: 6704
tool_uses: 4
duration_ms: 38164</usage>

status: completed

prompt:
Use context7 to find documentation about using the OpenAI Agents SDK with non-OpenAI models (custom models, alternative providers, LiteLLM, etc.).

Steps:
1. Use mcp__context7__resolve-library-id to find the OpenAI Agents SDK library ID
2. Use mcp__context7__query-docs to fetch docs about using custom/alternative model providers

Return the full relevant content about how to configure and use non-OpenAI models with the Agents SDK.

agentType: claude-code-guide

slug: virtual-nibbling-hartmanis


text: Let me query context7 directly.


ToolSearch

query: select:mcp__context7__resolve-library-id,mcp__context7__query-docs


query: select:mcp__context7__resolve-library-id,mcp__context7__query-docs


query: using non-OpenAI models custom model providers with OpenAI Agents SDK


text:
Available Libraries:

- Title: OpenAI Agents Python
- Context7-compatible library ID: /openai/openai-agents-python
- Description: The OpenAI Agents SDK is a framework for building multi-agent workflows, supporting various LLMs and featuring agents, handoffs, guardrails, sessions, and tracing.
- Code Snippets: 454
- Source Reputation: High
- Benchmark Score: 85.28
- Versions: v0_2_9, v0.7.0
----------
- Title: OpenAI Agents JS
- Context7-compatible library ID: /openai/openai-agents-js
- Description: The OpenAI Agents SDK is a JavaScript/TypeScript framework for building multi-agent workflows, supporting OpenAI APIs and more with features like handoffs, guardrails, and tracing.
- Code Snippets: 541
- Source Reputation: High
- Benchmark Score: 72.7
----------
- Title: OpenAI Agents JS
- Context7-compatible library ID: /websites/openai_github_io_openai-agents-js
- Description: The OpenAI Agents SDK for JavaScript and TypeScript allows developers to build and orchestrate AI agents, manage context, and integrate with various models and tools.
- Code Snippets: 3558
- Source Reputation: High
- Benchmark Score: 77.78
----------
- Title: OpenAI Agents Python
- Context7-compatible library ID: /websites/openai_github_io_openai-agents-python
- Description: The OpenAI Agents SDK enables building agentic AI apps with lightweight primitives like Agents, Handoffs, Guardrails, and Sessions, featuring built-in tracing for visualization and debugging.
- Code Snippets: 3350
- Source Reputation: High
- Benchmark Score: 72.79
----------
- Title: OpenAI Agents Go
- Context7-compatible library ID: /nlpodyssey/openai-agents-go
- Description: A lightweight, provider-agnostic Go framework for building multi-agent workflows, supporting OpenAI APIs and other LLMs.
- Code Snippets: 31
- Source Reputation: High
- Benchmark Score: 58.5


query: using non-OpenAI models custom model providers LiteLLM alternative LLM providers


text:
### Configure ModelProvider for Per-Run Custom Provider

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

Use ModelProvider at the Runner.run level to apply a custom model provider to all agents in a single run. This enables dynamic provider selection without modifying agent definitions.

```python
from agents import Runner, ModelProvider

# Use a custom ModelProvider for a specific run
result = await Runner.run(
    agent,
    input="your input",
    model_provider=CustomModelProvider()
)
```

--------------------------------

### Resolve Tracing Authentication Errors for Non-OpenAI Providers

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

Provides methods to resolve 401 errors when using non-OpenAI providers by either disabling tracing or setting a specific API key for trace exports.

```python
from agents import set_tracing_disabled, set_tracing_export_api_key

# Option 1: Disable tracing entirely
set_tracing_disabled(True)

# Option 2: Set an OpenAI key specifically for tracing
# This key must be from platform.openai.com
set_tracing_export_api_key("your-openai-api-key")
```

### Ways to integrate non-OpenAI providers

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

You can integrate other LLM providers with these built-in paths: 1. [`set_default_openai_client`][agents.set_default_openai_client] is useful in cases where you want to globally use an instance of `AsyncOpenAI` as the LLM client. This is for cases where the LLM provider has an OpenAI compatible API endpoint, and you can set the `base_url` and `api_key`. See a configurable example in [examples/model_providers/custom_example_global.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_global.py). 2. [`ModelProvider`][agents.models.interface.ModelProvider] is at the `Runner.run` level. This lets you say "use a custom model provider for all agents in this run". See a configurable example in [examples/model_providers/custom_example_provider.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_provider.py). 3. [`Agent.model`][agents.agent.Agent.model] lets you specify the model on a specific Agent instance. This enables you to mix and match different providers for different agents. See a configurable example in [examples/model_providers/custom_example_agent.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_agent.py). In cases where you do not have an API key from `platform.openai.com`, we recommend disabling tracing via `set_tracing_disabled()`, or setting up a [different tracing processor](../tracing.md). In these examples, we use the Chat Completions API/model, because many LLM providers still do not support the Responses API. If your LLM provider does support it, we recommend using Responses.

--------------------------------

### LiteLLM

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

LiteLLM support is included on a best-effort, beta basis for cases where you need to bring non-OpenAI providers into an Agents SDK workflow. If you are using OpenAI models with this SDK, we recommend the built-in [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] path instead of LiteLLM. If you need to combine OpenAI models with non-OpenAI providers, especially through Chat Completions-compatible APIs, LiteLLM is available as a beta option, but it may not be the optimal choice for every setup.

--------------------------------

### LiteLLM

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

If you need LiteLLM for a non-OpenAI provider, install `openai-agents[litellm]`, then start from [`examples/model_providers/litellm_auto.py`](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/litellm_auto.py) or [`examples/model_providers/litellm_provider.py`](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/litellm_provider.py). You can either use `litellm/...` model names or instantiate [`LitellmModel`][agents.extensions.models.litellm_model.LitellmModel] directly. If you want LiteLLM responses to populate the SDK's usage metrics, pass `ModelSettings(include_usage=True)`.


query: set_default_openai_client custom base_url api_key example code ModelProvider Agent model custom


text:
### Set Default OpenAI Client for Global Provider Integration

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

Configure a global AsyncOpenAI client instance with a custom base_url and api_key for OpenAI-compatible endpoints. This approach applies to all agents unless overridden at the agent or run level.

```python
from agents import set_default_openai_client, AsyncOpenAI

# Set a custom OpenAI-compatible endpoint globally
client = AsyncOpenAI(
    base_url="https://custom-provider.com/v1",
    api_key="your-api-key"
)
set_default_openai_client(client)
```

--------------------------------

### Configure Custom AsyncOpenAI Client in Python

Source: https://github.com/openai/openai-agents-python/blob/main/docs/config.md

Set a custom AsyncOpenAI client instance with specific configuration such as custom base URL and API key using the set_default_openai_client() function. This overrides the default SDK behavior of creating an AsyncOpenAI instance with environment variables.

```python
from openai import AsyncOpenAI
from agents import set_default_openai_client

custom_client = AsyncOpenAI(base_url="...", api_key="...")
set_default_openai_client(custom_client)
```

--------------------------------

### Configure MultiProvider for OpenAI-Compatible Endpoints in Python

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

Demonstrates how to set up a MultiProvider with custom base URLs and prefix modes to handle literal namespaced model IDs. This configuration is essential when using OpenAI-compatible backends like OpenRouter with websocket transport enabled.

```python
from agents import Agent, MultiProvider, RunConfig, Runner

provider = MultiProvider(
    openai_base_url="https://openrouter.ai/api/v1",
    openai_api_key="...",
    openai_use_responses_websocket=True,
    openai_prefix_mode="model_id",
    unknown_prefix_mode="model_id",
)

agent = Agent(
    name="Assistant",
    instructions="Be concise.",
    model="openai/gpt-4.1",
)

result = await Runner.run(
    agent,
    "Hello",
    run_config=RunConfig(model_provider=provider),
)
```

--------------------------------

### Configure ModelProvider for Per-Run Custom Provider

Source: https://github.com/openai/openai-agents-python/blob/main/docs/models/index.md

Use ModelProvider at the Runner.run level to apply a custom model provider to all agents in a single run. This enables dynamic provider selection without modifying agent definitions.

```python
from agents import Runner, ModelProvider

# Use a custom ModelProvider for a specific run
result = await Runner.run(
    agent,
    input="your input",
    model_provider=CustomModelProvider()
)
```

--------------------------------

### Customize Agent Execution with RunConfig in Python

Source: https://context7.com/openai/openai-agents-python/llms.txt

Illustrates how to use RunConfig to override an agent's default settings during a specific execution. This includes changing the model, adjusting temperature, and managing tracing or sensitive data logging.

```python
import asyncio
from agents import Agent, Runner, RunConfig, ModelSettings

agent = Agent(
    name="Assistant",
    instructions="Be helpful.",
    model="gpt-4o",
)

async def main():
    result = await Runner.run(
        agent,
        "Explain quantum computing briefly.",
        run_config=RunConfig(
            model="gpt-4o-mini",  # Override agent's model
            model_settings=ModelSettings(
                temperature=0.7,
                max_tokens=500,
            ),
            tracing_disabled=False,
            workflow_name="Quantum Explainer",
            trace_include_sensitive_data=False,
        ),
        max_turns=10,
    )
    print(result.final_output)

asyncio.run(main())
```


text:
Here's a summary of the right ways to use the OpenAI Agents SDK with non-OpenAI models:

---

## Three Integration Approaches

### 1. Global client override (OpenAI-compatible APIs)
Best when your provider has an OpenAI-compatible endpoint (e.g., Groq, Together, Ollama, OpenRouter).

```python
from openai import AsyncOpenAI
from agents import set_default_openai_client

client = AsyncOpenAI(
    base_url="https://your-provider.com/v1",
    api_key="your-api-key"
)
set_default_openai_client(client)
```

Applies globally to all agents.

---

### 2. Per-run via `ModelProvider` / `RunConfig`
For mixing providers across different runs, or using `MultiProvider` (e.g., OpenRouter):

```python
from agents import Agent, MultiProvider, RunConfig, Runner

provider = MultiProvider(
    openai_base_url="https://openrouter.ai/api/v1",
    openai_api_key="...",
)

result = await Runner.run(
    agent,
    "Hello",
    run_config=RunConfig(model_provider=provider),
)
```

---

### 3. LiteLLM (beta) — for truly non-OpenAI-compatible providers
Install: `pip install openai-agents[litellm]`

```python
from agents.extensions.models.litellm_model import LitellmModel
from agents import Agent, ModelSettings

agent = Agent(
    name="Assistant",
    model=LitellmModel(model="anthropic/claude-3-5-sonnet"),
    model_settings=ModelSettings(include_usage=True),  # to get usage metrics
)
```

Or use `litellm/...` model name strings directly. Note: LiteLLM support is **beta/best-effort**.

---

## Important: Tracing

If you don't have an OpenAI API key, tracing will throw 401 errors. Fix with either:

```python
from agents import set_tracing_disabled
set_tracing_disabled(True)

# OR keep tracing but use a separate OpenAI key for it:
from agents import set_tracing_export_api_key
set_tracing_export_api_key("your-openai-key")
```

---

**Recommendation:** For OpenAI-compatible providers (most modern LLM APIs), approach #1 or #2 is cleanest. For providers that aren't OpenAI-compatible, use LiteLLM (#3) but expect it to be rough around the edges since it's beta.


type: system


content: how do i turn off telemetry with CrewAI


query: disable telemetry turn off telemetry


text:
Available Libraries:

- Title: CrewAI
- Context7-compatible library ID: /crewaiinc/crewai
- Description: CrewAI is a Python framework for orchestrating autonomous AI agents, offering a lean, fast, and flexible approach to building AI-powered applications with granular control and scalability.
- Code Snippets: 2398
- Source Reputation: High
- Benchmark Score: 88.87
----------
- Title: CrewAI
- Context7-compatible library ID: /websites/crewai_en
- Description: CrewAI is a framework for building collaborative AI agents, crews, and flows with built-in guardrails, memory, knowledge, and observability for production-ready multi-agent systems.
- Code Snippets: 3818
- Source Reputation: High
- Benchmark Score: 87.04
----------
- Title: CrewAI
- Context7-compatible library ID: /websites/crewai
- Description: CrewAI is a Python framework for building autonomous AI agent teams that collaborate to solve complex tasks, offering flexible tools and intelligent workflow orchestration.
- Code Snippets: 502
- Source Reputation: High
- Benchmark Score: 75.21
----------
- Title: CrewAI (llmstxt)
- Context7-compatible library ID: /llmstxt/crewai_llms-full_txt
- Description: The CrewAI Enterprise API allows programmatic interaction with deployed crews for integration into applications, workflows, and services, enabling execution initiation, progress monitoring, and result retrieval.
- Code Snippets: 1237
- Source Reputation: High
----------
- Title: CrewAI (llmstxt)
- Context7-compatible library ID: /llmstxt/crewai_llms_txt
- Description: CrewAI is a framework for orchestrating autonomous AI agents to perform complex tasks collaboratively, offering features for agents, crews, tools, planning, and memory.
- Code Snippets: 1762
- Source Reputation: High
- Benchmark Score: 39


query: disable telemetry turn off telemetry opt out


text:
### Disable CrewAI Telemetry with Environment Variables

Source: https://github.com/crewaiinc/crewai/blob/main/docs/en/telemetry.mdx

Set environment variables to disable telemetry collection in CrewAI. Use CREWAI_DISABLE_TELEMETRY to disable only CrewAI telemetry, or OTEL_SDK_DISABLED to disable all OpenTelemetry instrumentation globally. This is useful for privacy-sensitive applications or development environments.

```python
import os

# Disable CrewAI telemetry only
os.environ['CREWAI_DISABLE_TELEMETRY'] = 'true'

# Disable all OpenTelemetry (including CrewAI)
os.environ['OTEL_SDK_DISABLED'] = 'true'
```

--------------------------------

### Disable Tracing with Code Flag - Python

Source: https://github.com/crewaiinc/crewai/blob/main/docs/en/concepts/cli.mdx

Disable trace collection by setting the tracing parameter to False in the Crew constructor. This is the highest priority setting and overrides environment variables and user preferences.

```python
crew = Crew(agents=[...], tasks=[...], tracing=False)
```

--------------------------------

### Disable Trace Collection - Shell

Source: https://github.com/crewaiinc/crewai/blob/main/docs/en/concepts/cli.mdx

Disable trace collection for Crew and Flow executions. This sets the user preference for tracing, which is checked if no explicit code-level or environment variable settings are present.

```shell
crewai traces disable
```

### Telemetry > Disabling Telemetry

Source: https://github.com/crewaiinc/crewai/blob/main/docs/en/telemetry.mdx

Users can disable telemetry in CrewAI by setting the environment variable `CREWAI_DISABLE_TELEMETRY` to `true` to disable CrewAI telemetry only, or by setting `OTEL_SDK_DISABLED` to `true` to disable all OpenTelemetry instrumentation globally, which includes CrewAI telemetry.

--------------------------------

### Telemetry

Source: https://github.com/crewaiinc/crewai/blob/main/README.md

CrewAI uses anonymous telemetry to collect usage data with the main purpose of helping improve the library by focusing efforts on the most used features, integrations and tools. Importantly, NO data is collected concerning prompts, task descriptions, agents' backstories or goals, usage of tools, API calls, responses, any data processed by the agents, or secrets and environment variables. Users can disable telemetry by setting the environment variable OTEL_SDK_DISABLED to true, and can opt-in to further telemetry by setting the `share_crew` attribute to `True` on their Crews.


text:
Three ways to disable CrewAI telemetry:

---

**Option 1: Environment variable (simplest)**

```bash
export CREWAI_DISABLE_TELEMETRY=true
```

Or to disable all OpenTelemetry globally:

```bash
export OTEL_SDK_DISABLED=true
```

---

**Option 2: In your Python code** (set before importing crewai)

```python
import os
os.environ['CREWAI_DISABLE_TELEMETRY'] = 'true'
```

---

**Option 3: Per-crew in code**

```python
crew = Crew(agents=[...], tasks=[...], tracing=False)
```

This is the highest-priority setting and overrides environment variables.

---

**Option 4: CLI**

```bash
crewai traces disable
```

The env var approach (`CREWAI_DISABLE_TELEMETRY=true` in your `.env` or shell profile) is the most common and persistent solution.


type: last-prompt

lastPrompt: how do i turn off telemetry with CrewAI