TypeScript wire SDK
@ingram-tech/ingram-cloud-sdk is the API wire contract in TypeScript: Zod
request/response schemas, SSE and webhook event types, and JSON response types.
The schemas are hand-authored and are the source of truth for the wire — the API
emits its OpenAPI document from these same schemas, and the IC* response types
are inferred from them. It describes the wire shapes; it is not an HTTP
client (there is no createClient here).
npm install @ingram-tech/ingram-cloud-sdk
To actually call the API, talk to the OpenAI-compatible
surface with the openai SDK or the AI SDK
adapter. Reach for this package when you want to validate wire
bodies at runtime or type the JSON you read back.
Validate a body
The schemas map holds one Zod schema per request and non-streaming response
body, keyed by its wire name. Parse against it to validate at the boundary:
import { schemas } from "@ingram-tech/ingram-cloud-sdk";
const agent = schemas.AgentIn.parse(input); // throws on a contract mismatch
Type a response
The responses entry point is Zod-free IC* interfaces for the JSON response
bodies — import type them so no runtime dependency is pulled in:
import type { ICSmith, ICRun, ICAgent } from "@ingram-tech/ingram-cloud-sdk/responses";
function render(smith: ICSmith) {
/* … */
}
Exports
.— theschemasZod map plus the SSE/webhook event types (EVENT_TYPES,webhookEvent,streamFrame, …)../schemas— just the Zodschemasmap../zod— the same schemas as individual named exports, one module per resource../responses— theIC*TypeScript response types. Zod-free.
The OpenAPI document itself is served by the API at
/docs/openapi.json, emitted from these schemas.
Coverage
Every resource's request bodies and non-streaming JSON responses are typed as
precise Zod, and the IC* types are inferred from the same schemas. A handful of
endpoints aren't part of the typed surface because they can't be a single
response schema: the streaming/union endpoints (/runs,
/chat/completions, /responses — each a stream or JSON from one handler),
deployment webhook acks, and the OAuth redirect. Their live frames are the
hand-authored {v:1} webhook/feed envelope and SSE run-stream types.
The OpenAI-compatible stream chunks themselves are standard — use the @ai-sdk/*
types for those rather than redefining them.
Published as TypeScript source. Bun runs it directly and bundlers (Next, Vite, esbuild) compile it; type-only imports work in any
tscproject. To consume the runtime Zod schemas from a plaintscNode build, transpile the package (e.g. NexttranspilePackages).