go-openai

Integrate OpenAI APIs in Go using the official openai-go SDK.

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/juburr/mad-skills --skill go-openai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-openai
Source: https://github.com/juburr/mad-skills/tree/main/go-openai
Command: npx skills add https://github.com/juburr/mad-skills --skill go-openai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables Go developers to integrate OpenAI APIs using the official Go SDK, reducing boilerplate and complexity when building AI-powered Go applications.

Core Features & Use Cases

  • Official Go SDK support for chat completions, streaming, and function/tool calling.
  • Structured outputs and reasoning model support, with provider compatibility for Azure OpenAI, vLLM, and Ollama.
  • Clear client configuration, error handling, and production-ready patterns via the option package.

Quick Start

Install the module and run a simple Go program that initializes the client and calls a chat completion.

Frequently Asked Questions about go-openai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate OpenAI chat completions into a Go application?

You can use the official OpenAI Go SDK to implement chat completions in your Go application by installing the github.com/openai/openai-go/v3 module and initializing the client with your API key.

Can I use the OpenAI Go SDK for streaming responses and tool calling?

Yes, the OpenAI Go SDK supports streaming responses and function or tool calling, allowing Go developers to handle real-time chat outputs and integrate external tools directly within their chat completion workflows.

Does the OpenAI Go SDK support structured outputs and reasoning models?

The OpenAI Go SDK supports structured outputs and reasoning models, enabling Go applications to parse formatted responses and utilize advanced reasoning capabilities for complex chat completions.

Can I use the OpenAI Go SDK with Azure OpenAI, vLLM, or Ollama?

The OpenAI Go SDK offers provider compatibility for Azure OpenAI, vLLM, and Ollama, allowing Go developers to configure clients to connect with these alternative providers using the option package.

What Go version is required for the official OpenAI Go SDK?

The official OpenAI Go SDK requires Go 1.22 or higher to integrate OpenAI APIs, utilizing the github.com/openai/openai-go/v3 module path for chat completions, streaming, and tool calling.

How do I handle configuration and errors when using the OpenAI Go SDK?

Handle configuration and errors in the OpenAI Go SDK using the option package, which provides clear client configuration and production-ready error handling patterns for AI-powered Go applications.