Responses API (Reasoning)

View as Markdown

Responses API (Reasoning Models)

Use the responses API to query o-series and similar models that provide reasoning efforts.

1const response = await client.responses.create({
2 model: "openai/o4-mini",
3 input: "Explain the halting problem in two sentences.",
4 reasoning: { effort: "medium" },
5 max_output_tokens: 512,
6});
7
8console.log(response.output);

Streaming works the same way via client.responses.create({ ...stream: true }).