Responses API (Reasoning)

View as Markdown

Responses API (Reasoning)

Access models like OpenAI’s o-series that require a specific reasoning interface.

1// Model is *string; Reasoning is a map[string]interface{}.
2model := "openai/o3-mini"
3resp, err := client.Responses.Create(ctx, meshapi.ResponsesParams{
4 Model: &model,
5 Input: "Explain quantum computing in one sentence.",
6 Reasoning: map[string]interface{}{"effort": "medium"},
7})
8
9if err == nil {
10 fmt.Println(resp.Output)
11}

Streaming is also supported via client.Responses.Stream(ctx, params).

Use client.Responses.List and client.Responses.Get for persisted/background response jobs. A response returned from a synchronous Create call is not guaranteed to be retrievable later by ID.