Claude Platform Docs

Go API リファレンス

メッセージを作成
client.Messages.New(ctx, params) (*Message, error)
POST/v1/messages

テキストや画像コンテンツを含む入力メッセージの構造化されたリストを送信すると、モデルが会話内の次のメッセージを生成します。

メッセージ内のトークンをカウント
client.Messages.CountTokens(ctx, params) (*MessageTokensCount, error)
POST/v1/messages/count_tokens

メッセージ内のトークン数をカウントします。

モデルの一覧
client.Models.List(ctx, params) (*Page[ModelInfo], error)
GET/v1/models

利用可能なモデルを一覧表示します。

モデルを取得
client.Models.Get(ctx, modelID, query) (*ModelInfo, error)
GET/v1/models/{model_id}

特定のモデルを取得します。

ファイルをアップロード
client.Files.Upload(ctx, params) (*FileMetadata, error)
POST/v1/files
ファイルの一覧
client.Files.List(ctx, params) (*PageCursor[FileMetadata], error)
GET/v1/files
ファイルをダウンロード
client.Files.Download(ctx, fileID, query) (*Response, error)
GET/v1/files/{file_id}/content
ファイルのメタデータを取得
client.Files.GetMetadata(ctx, fileID, query) (*FileMetadata, error)
GET/v1/files/{file_id}
ファイルを削除
client.Files.Delete(ctx, fileID, body) (*DeletedFile, error)
DELETE/v1/files/{file_id}
スキルを作成
client.Skills.New(ctx, params) (*Skill, error)
POST/v1/skills
スキルの一覧
client.Skills.List(ctx, params) (*PageCursor[Skill], error)
GET/v1/skills
スキルを取得
client.Skills.Get(ctx, skillID, query) (*Skill, error)
GET/v1/skills/{skill_id}
スキルを削除
client.Skills.Delete(ctx, skillID, body) (*DeletedSkill, error)
DELETE/v1/skills/{skill_id}

ユーザープロファイル

プラットフォームがサービスを提供するエンドカスタマーを登録し、各リクエストで対象者を指定できるようにします。始めるには、ユーザープロファイルガイドを参照してください。

ユーザープロファイルを作成
client.UserProfiles.New(ctx, params) (*UserProfile, error)
POST/v1/user_profiles

エンドカスタマーを1つ登録し、そのエンドカスタマーのために行うリクエストで送信するIDを取得します。

ユーザープロファイルの一覧を取得
client.UserProfiles.List(ctx, params) (*PageCursor[UserProfile], error)
GET/v1/user_profiles

組織内のユーザープロファイルの一覧を取得します。デフォルトでは新しい順に並びます。

ユーザープロファイルを取得
client.UserProfiles.Get(ctx, userProfileID, query) (*UserProfile, error)
GET/v1/user_profiles/{user_profile_id}

IDを指定してユーザープロファイルを取得し、保存されている詳細情報を確認します。

ユーザープロファイルを更新
client.UserProfiles.Update(ctx, userProfileID, params) (*UserProfile, error)
POST/v1/user_profiles/{user_profile_id}

ユーザープロファイルの詳細情報を変更します。送信しないフィールドはそのまま保持されます。

ユーザープロファイルを削除
client.UserProfiles.Delete(ctx, userProfileID, body) (*DeletedUserProfile, error)
DELETE/v1/user_profiles/{user_profile_id}

エンドカスタマーがアカウントを閉鎖した場合などに、ユーザープロファイルを削除します。

現在の組織を取得
client.Organization.Get(ctx) (*OrganizationInfo, error)
GET/v1/organizations/me

認証されたAPIキーに関連付けられた組織に関する情報を取得します。