> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Go SDK の使い方

> Go SDK で現在サポートされているラッパーメソッド。

## セットアップ

```go theme={null}
import (
  "context"
  phaseo "github.com/phaseoteam/Phaseo/packages/sdk/sdk-go/v3"
)

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

## チャット補完

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

## Responses

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

## 埋め込み

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

## モデレーション

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

## 画像と音声

```go theme={null}
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",
})
```

## モデル

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

## 現在の制限

Go ラッパーは、チャット、Responses、画像、音声、埋め込み、モデレーション、モデル、プロバイダー、バッチ、ファイル、生成の取得、ヘルスチェック、動画ヘルパーに対応しています。手書きのラッパーにまだ追加されていないエンドポイントには、低レベルの生成済み操作も引き続き使用できます。また、一般的なリクエスト型はラッパーパッケージから再エクスポートされています。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.