cpuosBeta

Integration · Agent framework

OpenAI Agents SDK with cpuOS jobs

Use the cpuOS REST jobs contract behind an application-owned tool. Keep model credentials out of submitted code.

Use REST calls from your application. No cpuOS SDK package, framework adapter or hosted MCP server is published. Confirm the capabilities described below before selecting a workflow.

Interface
REST /v1/jobs
Model endpoint
https://gpuos.si/v1 or any OpenAI-compatible
Status
BYO CPU pilot

Application-side integration

Implement a tool handler in your application that submits and polls a cpuOS job. Register it using the API of your installed Agents SDK version. The snippet below is the HTTP contract, not a maintained SDK adapter. Do not pass the cpuOS key to the model or into the job.

The current cpuOS interface is REST: POST /v1/jobs, GET /v1/jobs, GET /v1/jobs/:id and DELETE /v1/jobs/:id. Python and Node standard-library jobs run on your connected Docker worker. No cpuOS SDK package or framework adapter is published.

The supported HTTP contract

Use the Python API client for the execution boundary, or expose a fixed JSON validation task. Keep tool argument validation in the application even when the model returns syntactically valid JSON.

Submit from your server using fetch
const response = await fetch("https://cpuos.si/v1/jobs", {  method: "POST",  headers: {    Authorization: "Bearer " + process.env.CPUOS_API_KEY,    "Content-Type": "application/json",  },  body: JSON.stringify({    template: "python", code: "print(sum([12, 18, 25]))",    vcpu: 1, memoryMb: 512, timeoutSeconds: 30,  }),})if (!response.ok) throw new Error(await response.text())const job = await response.json()// GET /v1/jobs/:id until status is completed, failed or cancelled.// Use the result only after checking status and exitCode.

Poll GET /v1/jobs/:id with the same bearer key. Queued and running are intermediate states. Inspect completed, failed or cancelled, exitCode, stdout, stderr, error and outputTruncated before returning a tool result. Logs arrive at completion, not as a live stream.

Set limits and retain ownership

  • Keep the API key in your application, never in model context or job code.
  • Fix resource ceilings and deadline in your tool handler; do not accept arbitrary workspace or worker selection from the model.
  • Store the job id before polling, bound retries and avoid resubmitting after an ambiguous network failure.
  • Running cancellation is requested through DELETE and applied when the worker observes it; continue inspecting the job and node state.

Validate before connecting an agent

Use trusted team code and a worker machine allocated to this pilot. Docker containers share the host kernel. Test a known successful script, a failing script, a timeout and worker disconnection. Keep external side effects in separate authorized application operations.

The model can be served by gpuOS or another provider. Model inference and CPU jobs are separate calls, with a separate key for each product (one account and workspace can hold both) and no automatic cross-product integration.

Official documentation: openai.github.io/openai-agents-python

Questions

Is this a maintained cpuOS adapter?
No. The page describes an application-side REST boundary. Match any framework registration code to the version you install and validate your wrapper before using it.
Can jobs install packages or access my network?
No job network is provided. Current Python and Node images support standard-library scripts. There is no package-installation contract, browser image or exposed port.
Does execution have an independent kernel?
No. Jobs run in restricted Docker containers on your worker and share its kernel. This pilot is for trusted team code on a purpose-allocated machine.

Related

Start with a supported CPU task

Connect a Docker worker and validate a bounded Python or Node job before wiring an agent tool.

gpuOS · where models think

Need the model too? Run it on gpuOS

gpuOS serves open models on your own GPUs behind one OpenAI-compatible API. Your application can submit authorized actions to cpuOS jobs.