← API Reference

Language Guide · Go

Manage AI Prompts in Go

No SDK required. One HTTP call.

Fetch versioned, variable-interpolated AI prompts from Go using the standard net/http package. No new dependencies, no vendor bloat — just a plain HTTP GET.

Code Example

One function. Any AI provider.

Fetch a versioned, interpolated prompt from PromptForge with a single HTTP call. The returned content string passes directly to your AI SDK — no transformation, no adapter, no extra library.

  1. 1Fetch a versioned prompt by ID with your variable values.
  2. 2Receive the fully rendered content string in the response.
  3. 3Pass it directly to your AI provider SDK as the system prompt.
promptforge.go
Go
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func fetchPrompt(apiKey, promptID, role, task string) (string, error) {
	url := "https://www.promptforge-app.com/api/v1/prompts/" + promptID +
		"?_version=latest&role=" + role + "&task=" + task

	req, _ := http.NewRequest(http.MethodGet, url, nil)
	req.Header.Set("Authorization", "Bearer "+apiKey)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	var result struct {
		Content string `json:"content"`
	}
	body, _ := io.ReadAll(resp.Body)
	json.Unmarshal(body, &result)
	return result.Content, nil
}

Why Go teams choose PromptForge

Designed for developers who want control without complexity.

No new dependencies

Uses only net/http, encoding/json, and io from the Go standard library. Your go.sum stays clean and your builds stay reproducible.

Fits your existing HTTP patterns

The same http.NewRequest pattern you already use in your service handlers. No new concepts, no new abstractions to learn.

Deploy anywhere

Single static binary, Lambda, Cloud Run, or bare metal — the PromptForge call is just an outbound HTTP request. No runtime dependencies to manage.

Integrate in 4 steps

From zero to fetching your first versioned prompt in under 10 minutes. No framework setup, no SDK installation — just HTTP.

  1. 1

    Create a prompt with variables

    Open the dashboard, click New Prompt, and write your system prompt using {{variable}} placeholders for any dynamic values.

  2. 2

    Copy your prompt ID

    Your prompt ID appears in the URL bar when editing: /dashboard/prompts/YOUR_PROMPT_ID. The API Usage panel also shows it with pre-filled examples.

  3. 3

    Generate an API key

    Go to the API settings page and click Generate Key. Pass it to your service via an environment variable.

  4. 4

    Call with net/http

    Set the Authorization header on a standard GET request, read the body, and unmarshal the JSON into a struct with a Content field. Pass the string to your AI provider client.

Teams building AI features in Go

Go microservice teams use PromptForge to keep AI prompts out of compiled binaries. When a prompt needs tuning, the change goes live on the next request — no rebuild, no redeployment, no coordination with the ops team.

Start Free Trial
No SDK
required
1 call
to fetch any prompt
Instant
prompt updates
Any AI
provider supported

Start for free, upgrade anytime

No credit card required to get started. Paid plans include a 14-day free trial.

Developer Sandbox
Hobby Plan
$0/ forever
  • 1 Production Prompt
  • 1,000 API Requests/mo
  • Stable/Latest Channel Routing
  • No Credit Card Required
Launch Sandbox
Starter
14-day free trial
$9/month

No charge until your trial ends

  • 10k API requests/month
  • 5 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-Day Free Trial
Most Popular
Pro
14-day free trial
$29/month

No charge until your trial ends

  • 100k API requests/month
  • 25 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-Day Free Trial
Business
14-day free trial
$49/month

No charge until your trial ends

  • 500k API requests/month
  • 100 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-Day Free Trial

Questions? Contact us