Requests
Use the compile-checked Codex request as the complete server-side flow. Supply credentials through configuration, send a RuntimeRunStartBody, then poll the returned run_id while its normalized status is started or running. A successful terminal result has status: "completed" and provider output in output.
This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.
Referenced examples
Verified example · TypeScript
Runtime node
examples/runtime-node.ts
@cavi-ai/api-clientv0.16.048214137
import { CodexApiClient } from "@cavi-ai/api-client/providers/codex/runtime";
export async function runQuickstart(apiKey: string) {
const client = new CodexApiClient({
apiKey,
defaultModel: "gpt-5",
});
let run = await client.startRun({
input: "Summarize why capability checks matter in one sentence.",
});
while (run.status === "started" || run.status === "running") {
await new Promise((resolve) => setTimeout(resolve, 1_000));
run = await client.getRun(run.run_id);
}
return run;
}
Package imports
Referenced by
Artifact provenance
- Package
- @cavi-ai/api-client@0.16.0
- Release
- v0.16.0
- Commit
482141371d7fdb2dd38f7d6eaa5732aec669385a- Source
examples/runtime-node.ts- Tarball SHA-256
f8ca0ce45d7bf563b1212c708668a5fe788967b8b7d5dbdc9e119e9e09d60167- Content SHA-256
274cf7e926de9581e270ef9bf6120666e7f0595ddf98b6378d7b9921fcff88d3