Documentation
Capabilities & Modes
How the SDK keeps mode defaults explicit instead of magical.
Why this exists
The capability model exists so `mode: "auto"` is predictable and inspectable. It tells the SDK which provider path supports hosted MCP, which supports inline tools, and which mode should be chosen by default for that exact API variant.
Public helpers
- AdapterMode: `"auto" | "hosted" | "inline"`
- ResolvedMode: `"hosted" | "inline"`
- getCapability(...): inspect one provider/API capability row.
- resolveMode(...): resolve the effective mode for a path.
- resolveRequestedMode(...): reconcile `mode` and legacy `delivery` safely.
Resolution model
TS
const capability = milkey.openai.responses.capabilitiesconst resolution = milkey.openai.responses.resolveMode({ mode: "auto",}) console.log(capability.recommendedMode) // "hosted"console.log(resolution.selectedMode) // "hosted"- If a provider path does not support hosted mode, requesting hosted throws a config error.
- If a provider path does not support inline mode, requesting inline throws a config error.
- If `mode` and legacy `delivery` disagree, the SDK throws instead of silently picking one.
Design boundary
This layer exists to keep defaults explicit and safe. It is not a hidden router and it is not trying to outsmart the application.