Runnable OpenAI Agents SDK examples using the official capsolver-agent executor.
Examples only: this repository does not publish an additional Python library.
The demo uses OpenAI Agents SDK function tools as a thin framework boundary. Tool execution, schemas, supported CAPTCHA types, retries, and errors remain centralized in CapSolver Agent and Core.
git clone https://github.com/capsolver-ai/openai-agent-capsolver.git
cd openai-agent-capsolver
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtExport .env.example values, then run python examples/quickstart.py.
from agents import Agent, function_tool
from capsolver_agent import create_executor
capsolver = create_executor()
@function_tool
async def get_capsolver_balance() -> str:
return str(await capsolver.execute("get_balance", {}))
agent = Agent(name="CapSolver demo", tools=[get_capsolver_balance])See examples/quickstart.py for the complete runner flow and a solve tool.
examples/quickstart.py OpenAI agent, runner, and function tools
requirements.txt Shared SDK repositories plus openai-agents
tests/test_demo.py Offline validation
.github/workflows/ci.yml Demo checks
Use the example only for lawful, user-authorized workflows that respect target-site terms. Never commit API keys or private target data.
See CONTRIBUTING.md, SUPPORT.md, and SECURITY.md. Licensed under the ISC License.
OpenAI and the OpenAI Agents SDK are third-party to this repository. This project is maintained by CapSolver and is not affiliated with or endorsed by OpenAI.