### Create a Session with codex harness via OpenAI SDK Source: https://minimax-ai.github.io/OpenAgentCore Creates a Session with the OpenAI SDK, using the codex harness and the responses model protocol. Configure OPENAI_BASE_URL, MODEL, BASE_URL, and API_KEY beforehand. The session input is "Fix the failing test and explain the change.". ```python ``` from openai import OpenAI client = OpenAI() # OPENAI_BASE_URL → your Core session = client.beta.agents.sessions.create( environment={"type": "openai_hosted"}, input="Fix the failing test and explain the change.", extra_body={ "agent": {"model": MODEL, "x_agents_core": {"harness": "codex"}}, "x_agents_core": {"model_provider": { "protocol": "responses", "base_url": BASE_URL, "api_key": API_KEY, }}, }, ) ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.