Integrations

Uncensored LLM for Go

Send OpenAI-compatible chat completions from Go by pointing your HTTP client at abliteration.ai.

Updated 2026-08-04

Use the standard Go http client to call the /v1/chat/completions endpoint.

package main

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

func main() {
  payload := map[string]any{
    "model": "abliterated-model",
    "messages": []map[string]string{
      {"role": "user", "content": "Hello from Go."},
    },
  }

  body, _ := json.Marshal(payload)
  req, _ := http.NewRequest("POST", "https://api.abliteration.ai/v1/chat/completions", bytes.NewBuffer(body))
  req.Header.Set("Authorization", "Bearer "+os.Getenv("ABLIT_KEY"))
  req.Header.Set("Content-Type", "application/json")

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

  raw, _ := io.ReadAll(resp.Body)
  fmt.Println(string(raw))
}
FAQ

Frequently asked questions.

How do I fix a 401 Unauthorized error from abliteration.ai?

Check that your API key is set and sent as a Bearer token.

How do I fix a 404 Not Found error from abliteration.ai?

Make sure the base URL ends with /v1 and you call /chat/completions.

How do I fix a 400 Bad Request error from abliteration.ai?

Verify the model id and that messages are an array of { role, content } objects.

How do I fix a 429 Rate limit error from abliteration.ai?

Back off and retry. Use the Retry-After header for pacing.