Examples and guides for using the OpenAI API
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 760" role="img" aria-labelledby="title desc">
<title id="title">Workspace Agent API trigger flow</title>
<desc id="desc">A source event moves through a backend worker, API trigger, Workspace Agent, and output destination. The API trigger is engineering-owned. The Workspace Agent is business-owned.</desc>
<defs>
<pattern id="dot-grid" width="8" height="8" patternUnits="userSpaceOnUse">
<rect width="8" height="8" fill="#0b0b0b"/>
<circle cx="1.5" cy="1.5" r="0.6" fill="#1d1d1d"/>
</pattern>
<pattern id="green-dots" width="8" height="8" patternUnits="userSpaceOnUse">
<rect width="8" height="8" fill="#11190e"/>
<circle cx="1.5" cy="1.5" r="0.8" fill="#5f8f35"/>
</pattern>
<pattern id="blue-dots" width="8" height="8" patternUnits="userSpaceOnUse">
<rect width="8" height="8" fill="#101827"/>
<circle cx="1.5" cy="1.5" r="0.8" fill="#5f84ff"/>
</pattern>
<marker id="arrow-green" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto" markerUnits="strokeWidth">
<path d="M2,2 L10,6 L2,10 Z" fill="#8fbd5f"/>
</marker>
<marker id="arrow-black" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto" markerUnits="strokeWidth">
<path d="M2,2 L10,6 L2,10 Z" fill="#f2f2f2"/>
</marker>
<style>
.bg { fill: #070707; }
.title { fill: #f3f3f3; font: 700 30px Arial, sans-serif; }
.subtitle { fill: #bdbdbd; font: 400 16px Arial, sans-serif; }
.mono { fill: #f3f3f3; font: 700 18px Menlo, Consolas, monospace; letter-spacing: 0.3px; }
.mono-small { fill: #b7b7b7; font: 400 15px Menlo, Consolas, monospace; }
.small { fill: #c8c8c8; font: 400 14px Arial, sans-serif; }
.label { fill: #f3f3f3; font: 700 15px Arial, sans-serif; }
.track { stroke: #4a4a4a; stroke-width: 2; }
.pill { fill: #111111; stroke: #f0f0f0; stroke-width: 2; }
.eng-pill { fill: #101827; stroke: #6f92ff; stroke-width: 2.5; }
.biz-pill { fill: #11190e; stroke: #8fbd5f; stroke-width: 2.5; }
.arrow { stroke: #8fbd5f; stroke-width: 2.5; fill: none; marker-end: url(#arrow-green); }
.arrow-black { stroke: #f2f2f2; stroke-width: 2; fill: none; marker-end: url(#arrow-black); }
.legend { fill: #090909; stroke: #f0f0f0; stroke-width: 1.8; }
.legend-fill { fill: #090909; opacity: 0; }
.swatch-eng { fill: #101827; stroke: #6f92ff; stroke-width: 2; }
.swatch-biz { fill: #11190e; stroke: #8fbd5f; stroke-width: 2; }
</style>
</defs>
<rect class="bg" x="0" y="0" width="1280" height="760"/>
<text class="title" x="56" y="66">Workspace Agent API trigger flow</text>
<text class="subtitle" x="56" y="96">The backend starts the run. The Workspace Agent follows the saved workflow and writes the result.</text>
<g id="headers">
<rect class="pill" x="62" y="152" width="190" height="78" rx="32"/>
<text class="mono" x="157" y="191" text-anchor="middle" dominant-baseline="middle">SOURCE</text>
<rect class="pill" x="310" y="152" width="190" height="78" rx="32"/>
<text class="mono" x="405" y="191" text-anchor="middle" dominant-baseline="middle">BACKEND</text>
<rect class="eng-pill" x="558" y="152" width="190" height="78" rx="32"/>
<text class="mono" x="653" y="191" text-anchor="middle" dominant-baseline="middle">API TRIGGER</text>
<rect class="biz-pill" x="806" y="152" width="190" height="78" rx="32"/>
<text class="mono" x="901" y="181" text-anchor="middle" dominant-baseline="middle">WORKSPACE</text>
<text class="mono-small" x="901" y="205" text-anchor="middle" dominant-baseline="middle">AGENT</text>
<rect class="pill" x="1054" y="152" width="190" height="78" rx="32"/>
<text class="mono" x="1149" y="191" text-anchor="middle" dominant-baseline="middle">OUTPUT</text>
</g>
<g id="tracks">
<line class="track" x1="157" y1="230" x2="157" y2="570"/>
<line class="track" x1="405" y1="230" x2="405" y2="570"/>
<line class="track" x1="653" y1="230" x2="653" y2="570"/>
<line class="track" x1="901" y1="230" x2="901" y2="570"/>
<line class="track" x1="1149" y1="230" x2="1149" y2="570"/>
</g>
<g id="flow">
<path class="arrow" d="M157 296 L392 296"/>
<text class="mono-small" x="194" y="284">form submitted</text>
<path class="arrow" d="M405 372 L640 372"/>
<text class="mono-small" x="452" y="360">POST /trigger</text>
<text class="mono-small" x="452" y="388">with retry key</text>
<path class="arrow" d="M653 448 L888 448"/>
<text class="mono-small" x="700" y="436">202 Accepted</text>
<text class="mono-small" x="700" y="464">run queued</text>
<path class="arrow" d="M901 524 L1136 524"/>
<text class="mono-small" x="946" y="512">write final result</text>
</g>
<g id="legend">
<rect class="legend" x="102" y="620" width="1076" height="84" rx="18"/>
<rect class="legend-fill" x="102" y="620" width="1076" height="84" rx="18"/>
<text class="label" x="136" y="655">Legend</text>
<rect class="swatch-eng" x="136" y="674" width="18" height="18" rx="4"/>
<text class="label" x="166" y="689">Engineering-owned</text>
<text class="small" x="326" y="689">Trigger call, tokens, secrets, and logs.</text>
<rect class="swatch-biz" x="702" y="674" width="18" height="18" rx="4"/>
<text class="label" x="732" y="689">Business-owned</text>
<text class="small" x="880" y="689">Instructions, context, approvals, and output.</text>
</g>
</svg>