Use this skill when the user is building with `xsai` or any `@xsai/*` package, or is evaluating xsAI for a small OpenAI-compatible workflow with text generation, streaming, tool calling, structured output, embeddings, image generation, speech synthesis, or transcription.
Use this skill for xsai code, package selection, API selection, canonical examples, and positioning.
xsai or any @xsai/* package.xsai with larger SDKs such as ai or pi and wants the tradeoffs framed clearly.xsai versus granular @xsai/* imports unless the user asks to change them.xsai package only when the user needs several features at once or explicitly wants one dependency.references/recipes.md first and start from the closest canonical example.baseURL and model explicitly. Include apiKey for hosted providers; omit it only when the target endpoint truly does not need one.@xsai/generate-text over xsai.references/recipes.md when the user wants code, edits xsAI code, or needs a canonical minimal example.references/package-selection.md when the user needs help choosing between xsai and granular packages.references/text-stream-tools.md for generateText, streamText, tool calling, and common chat options.references/structured-output.md for generateObject, streamObject, tool(), rawTool(), or schema guidance.references/media-and-embeddings.md for embeddings, image generation, speech, or transcription.references/extensions.md only when the user explicitly needs xsAI extensions such as predefined providers, the OpenAI Responses API, or OTEL telemetry.generateText for unary text generation.streamText for incremental text, reasoning deltas, tool events, or lightweight agent loops.generateObject for validated structured output.streamObject when the user needs incremental object parsing.tool() when the user has a Standard Schema library such as Zod or Valibot.rawTool() when the user already has raw JSON Schema.Tool object only when the repo already uses that shape or when avoiding tool()'s async setup matters.baseURL and model are usually required in practice for xsAI calls.apiKey is provider-dependent. Most hosted providers need it; local or proxy endpoints may not.streamText() returns immediately; callers consume textStream, fullStream, and result promises asynchronously.streamObject() is async because schema conversion happens before streaming starts.maxSteps controls repeated tool-use loops by issuing additional API calls with tool results appended.generateObject(), streamObject(), and tool() rely on xsschema; some schema vendors need extra JSON Schema converter packages.ai or pi, focus on size, runtime portability, OpenAI-compatible scope, and simpler primitives. Do not oversell feature breadth.https://xsai.js.org/docs