Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-gpt3

> AI 编程
Open source

An OpenAI GPT-3 API client enabling Go/Golang programs to interact with the gpt3 APIs.

387 stars0 likes1 views
WebsiteGitHub

About

An OpenAI GPT-3 API client enabling Go/Golang programs to interact with the gpt3 APIs.

go-gpt3

An OpenAI GPT-3 API client enabling Go/Golang programs to interact with the gpt3 APIs.

Supports using the completion APIs with or without streaming.

Usage

Simple usage to call the main gpt-3 API, completion:

go
client := gpt3.NewClient(apiKey)
resp, err := client.Completion(ctx, gpt3.CompletionRequest{
    Prompt: []string{"2, 3, 5, 7, 11,"},
})

fmt.Print(resp.Choices[0].Text)
// prints " 13, 17, 19, 23, 29, 31", etc

Documentation

Check out the go docs for more detailed documentation on the types and methods provided: https://pkg.go.dev/github.com/PullRequestInc/go-gpt3

Full Examples

Try out any of these examples with putting the contents in a main.go and running go run main.go. I would recommend using go modules in which case you will also need to run go mod init within your test repo. Alternatively you can clone this repo and run the test script with go run cmd/test/main.go.

You will also need to have a .env file that looks like this to use these examples:

API_KEY=
…

Support

  • List Engines API
  • Get Engine API
  • Completion API (this is the main gpt-3 API)
  • Streaming support for the Completion API
  • Document Search API
  • Overriding default url, user-agent, timeout, and other options

Powered by

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gogogolanggpt-3gpt3

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.