Documentation
OpenAI Responses
Use the recommended OpenAI hosted path first, then inline mode only when you need full loop ownership.
Overview
OpenAI Responses is the best OpenAI-native hosted MCP path in the SDK and is the recommended choice for new OpenAI integrations.
Inline mode is still available, but most teams should start with hosted mode here because it keeps the app surface thinner while staying provider-native.
Recommended
Recommended default: hosted
Supported modes
hosted, inline, auto
Helpers
- milkey.openai.responses.tools(...)
- milkey.openai.responses.outputs(...)
- milkey.openai.responses.resolveMode(...)
Examples
Full GitHub example
Use the complete provider example in the SDK repo when you want the full runnable file with imports, env handling, and a realistic integration shape. Open the GitHub example.
import OpenAI from "openai"import { milkey } from "@milkeyskills/sdk" const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY!,}) const milkeyClient = milkey.createClient({ baseUrl: process.env.MILKEY_BASE_URL!, apiKey: process.env.MILKEY_API_KEY!,}) const tools = milkey.openai.responses.tools({ client: milkeyClient, mode: "hosted",}) const response = await openai.responses.create({ model: process.env.OPENAI_MODEL ?? "gpt-5", input: "Find the best Milkey skill for PostgreSQL query optimization.", tools,}) console.log(response.output_text)Hosted
examples/openai-responses.ts
Inline follow-up
Edge cases and production notes
- If you can choose only one OpenAI path for documentation and onboarding, make it Responses hosted.
- Use inline only when you need to inspect and control every follow-up item yourself.
Watch for these edges
- Inline Responses loops must still enforce a max turn count in your application.
- Hosted mode keeps tool delivery off your orchestration path, but your app still owns prompts, business logic, and auditing.