OpenAI Agents SDK with an uncensored model

To run OpenAI Agents SDK with an uncensored model, pass an AsyncOpenAI client with a custom base URL to OpenAIChatCompletionsModel and pick an abliterated model id.

Updated November 18, 2026By unrestrictedaiagent
agent.pyPython
import asyncio, os
from agents import (Agent, AsyncOpenAI, OpenAIChatCompletionsModel,
                    Runner, function_tool, set_tracing_disabled)

set_tracing_disabled(disabled=True)
client = AsyncOpenAI(base_url="https://api.silkcompute.com",
                     api_key=os.environ["SILK_API_KEY"])

@function_tool
def read_note(name: str) -> str:
    """Read one of my notes from ./notes."""
    return open(f"notes/{name}.md").read()

agent = Agent(
    name="Assistant",
    instructions="Work only on the user's own files and accounts.",
    model=OpenAIChatCompletionsModel(model="kimi-k3.1-pro-uncensored",
                                     openai_client=client),
    tools=[read_note],
)

result = asyncio.run(Runner.run(agent, "Turn my todo note into a plan."))
print(result.final_output)
OpenAI format
OpenAIChatCompletionsModel
Anthropic format
Through an adapter
Tool calling
@function_tool
Streaming
Runner.run_streamed
Browser use
ComputerTool is for OpenAI models
Memory
Sessions

Labels link to OpenAI Agents SDK's own docs, read November 18, 2026. Compare all 11

Point the agent only at systems, files and accounts you own or are allowed to test.

Deploy it

3 steps, with Kimi K3.1 Pro.

  1. 01

    Install the SDK. Python 3.10 or newer.

    Terminal
    pip install openai-agents
    export SILK_API_KEY=...
  2. 02

    Point a client at the base URL. The SDK docs advise OpenAIChatCompletionsModel for other providers, and tracing off without an OpenAI key.

    See agent.py above
  3. 03

    Run it. The run ends when the model answers without calling a tool.

    Terminal
    python agent.py

Which model

The config uses the Silk Compute base URL, which serves both models with a 1,048,576-token context.

Sources

More frameworks