> ## Documentation Index
> Fetch the complete documentation index at: https://authsome.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Agents SDK

> Replace OPENAI_API_KEY env-var management with authsome. The Agents SDK works unchanged.

The [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) reads `OPENAI_API_KEY` from the environment by default. Authsome supplies it either through the proxy (recommended) or through `export`.

## Recommended: run the agent under the proxy

```bash theme={null}
authsome login openai
authsome run -- python my_agent.py
```

The Agents SDK initializes with `OPENAI_API_KEY=authsome-proxy-managed`. Outbound requests to `api.openai.com` are intercepted and authenticated at the proxy layer. The agent's process never sees the real key.

## Alternative: export into the environment

```bash theme={null}
eval "$(authsome export openai --format env)"
python my_agent.py
```

## Multi-account workflows

```bash theme={null}
authsome login openai --connection personal
authsome login openai --connection team
```

```bash theme={null}
eval "$(authsome export openai --connection team --format env)"
```

## Tools that hit other providers

The Agents SDK supports tools that call external APIs. Each tool typically reads its own credential. Authsome covers both bundled (OpenAI, GitHub, etc.) and custom (see [Custom providers](/guides/custom-providers)).

For an MCP-style tool that calls `api.github.com`, just log in once: `authsome login github`. The proxy will inject the GitHub token automatically when the tool makes its request.

## What's next

<Columns cols={2}>
  <Card title="OpenAI integration" icon="key" href="/integrations/api-key/openai">
    Set up the underlying OpenAI key.
  </Card>

  <Card title="Run agents with the proxy" icon="shield-halved" href="/guides/run-agents-with-proxy">
    The injection model in detail.
  </Card>
</Columns>
