Skip to main content
Use the wrapper method:
  • client.GenerateResponse(ctx, req)
import (
  "context"
  "fmt"
  aistats "github.com/AI-Stats/ai-stats-go-sdk-wrapper"
  gen "github.com/AI-Stats/ai-stats-go-sdk-wrapper/src/gen"
)

client := aistats.New(apiKey, "https://api.phaseo.app/v1")
input := map[string]interface{}{
  "role": "user",
  "content": []map[string]interface{}{
    {
      "type": "input_text",
      "text": "Reply with: responses endpoint works",
    },
  },
}
resp, err := client.GenerateResponse(context.Background(), gen.ResponsesRequest{
  Model: "openai/gpt-5-nano",
  Input: &input,
})
if err != nil {
  panic(err)
}

fmt.Println(resp)
Streaming is not yet exposed as a dedicated helper in the wrapper.
Last modified on February 18, 2026