Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt

Use this file to discover all available pages before exploring further.

Setup

import (
  "context"
  aistats "github.com/AI-Stats/AI-Stats/packages/sdk/sdk-go"
)

client := aistats.New("<API_KEY>", "https://api.phaseo.app/v1")
ctx := context.Background()

Chat completions

chatReq := aistats.ChatCompletionsRequest{
  Model: "openai/gpt-5-nano",
  Messages: []map[string]interface{}{
    {"role": "user", "content": "Hello"},
  },
}
chatResp, err := client.GenerateText(ctx, chatReq)

Responses

input := map[string]interface{}{
  "role": "user",
  "content": []map[string]interface{}{
    {"type": "input_text", "text": "Reply with: go sdk works"},
  },
}
resp, err := client.GenerateResponse(ctx, aistats.ResponsesRequest{
  Model: "openai/gpt-5-nano",
  Input: &input,
})

Embeddings

embedding, err := client.GenerateEmbedding(ctx, map[string]interface{}{
  "model": "openai/text-embedding-3-large",
  "input": "Sample text",
})

Moderations

moderation, err := client.GenerateModeration(ctx, map[string]interface{}{
  "model": "openai/omni-moderation-latest",
  "input": "Some text to check",
})

Images and audio

image, err := client.CreateImage(ctx, map[string]interface{}{
  "model": "openai/gpt-image-1",
  "prompt": "A lighthouse at golden hour",
})

speech, err := client.CreateSpeech(ctx, map[string]interface{}{
  "model": "openai/gpt-4o-mini-tts",
  "input": "Hello from Go",
})

Models

models, err := client.GetModels(ctx, map[string]string{"limit": "10"})

Current limits

The Go wrapper now covers chat, responses, images, audio, embeddings, moderations, models, providers, batches, files, generation lookup, health, and video helpers. Lower-level generated operations remain available for endpoints that have not been promoted to the handwritten wrapper yet, but common request types are re-exported from the wrapper package.
Last modified on May 6, 2026