> ## 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

> Phaseo Gateway 的官方 Go 客户端。

安装已发布的 [`sdk-go/v3`](https://pkg.go.dev/github.com/phaseoteam/Phaseo/packages/sdk/sdk-go/v3) 模块。

本地封装 `packages/sdk/sdk-go/index.go` 目前提供以下方法：

* `GenerateText(...)`
* `GenerateResponse(...)`
* `GenerateEmbedding(...)`
* `GenerateModeration(...)`
* `CreateSpeech(...)`, `CreateTranscription(...)`, `CreateTranslation(...)`
* `CreateAnthropicMessage(...)`
* `GetModels(...)`
* `GetModelEndpointCapabilities(...)`, `CheckModelParameters(...)`
* `ListOrganisations(...)`
* `ListPricingModels(...)`
* `CalculatePricing(...)`
* `ListApiKeys(...)`
* `CreateApiKey(...)`, `UpdateApiKey(...)`, `DeleteApiKey(...)`
* `GetApiKey(...)`
* `ListWorkspaces(...)`, `GetWorkspace(...)`, `CreateWorkspace(...)`, `UpdateWorkspace(...)`, `DeleteWorkspace(...)`
* `GetCurrentApiKey(...)`
* `ListEndpoints(...)`
* `ListProviders(...)`
* `GetAnalytics(...)`, `GetCredits(...)`, `GetActivity(...)`
* `CreateBatch(...)`, `RetrieveBatch(...)`, `CancelBatch(...)`
* `GetAsyncJobWebSocketURL(...)`, `GetBatchWebSocketURL(...)`, `GetVideoWebSocketURL(...)`, `client.AsyncJobs.WebSocketURL(...)`
* `ListFiles(...)`, `RetrieveFile(...)`, `RetrieveFileContent(...)`
* `RetrieveVideoContent(...)`, `GetVideoDownloadURL(...)`
* `GetGeneration(...)`
* `Health(...)`
* `GetModelDeprecationInfo(...)`, `ValidateModel(...)`
* `CreateImage(...)`, `CreateImageEdit(...)`
* `GenerateVideo(...)`, `GetVideo(...)`, `CancelVideo(...)`, `DeleteVideo(...)`
* `ListVideoModels(...)`, `ListVideos(...)`

对于尚未封装到本地 wrapper 的端点，请直接使用 `packages/sdk/sdk-go/src/gen` 中生成的客户端。

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

client := phaseo.New("YOUR_KEY", "https://api.phaseo.app/v1")
models, err := client.GetModels(context.Background(), map[string]string{"limit": "5"})
if err != nil {
  panic(err)
}
fmt.Println(models)
```

`CheckModelParameters` 使用提供商路由的实时元数据，将各参数标记为 `supported`、`partial`、`unsupported` 或 `unknown`，验证公布的值和范围，并返回接受完整参数集的路由。


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