sashabaranov/go-openai
OpenAI, GPT 5.6, GPT-Image-2, Whisper API clients for Go
What it solves
It provides a way for developers using the Go programming language to interact with the OpenAI API without having to write raw HTTP requests manually.
How it works
It acts as an unofficial client library that wraps OpenAI's API endpoints into Go functions and types. It supports the latest Responses API for text generation and reasoning, as well as legacy Chat Completions. The library handles the communication with OpenAI's servers, allowing developers to send requests for text, images, audio, and fine-tuning, and receive structured responses or stream data in real-time.
Who it’s for
Go developers who want to integrate OpenAI's models (like GPT-5.6 or GPT-4o) into their applications, including those using Azure OpenAI services.
Highlights
- Comprehensive API Coverage: Supports text generation, reasoning, tool-calling, embeddings, images, audio, moderation, files, fine-tuning, batches, and vector stores.
- Modern API Support: First-class support for the Responses API and multi-turn conversations using response IDs.
- Streaming: Ability to stream output text in real-time for a more responsive user experience.
- Flexible Configuration: Allows customization of HTTP clients, base URLs, and organization headers, making it compatible with other OpenAI-compatible endpoints.
- Azure Integration: Includes specific configuration helpers for Azure OpenAI deployments.
Related
- Project
- Project
- Project
- Project
- Dispatch