Go API reference
Create a Text Completion
Deprecated
client.Completions.New(ctx, params) (*Completion, error)POST/v1/complete
[Legacy] Create a Text Completion.
Create a Message
client.Messages.New(ctx, params) (*Message, error)POST/v1/messages
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
Count tokens in a Message
client.Messages.CountTokens(ctx, params) (*MessageTokensCount, error)POST/v1/messages/count_tokens
Count the number of tokens in a Message.
List Models
client.Models.List(ctx, params) (*Page[ModelInfo], error)GET/v1/models
List available models.
Get a Model
client.Models.Get(ctx, modelID, query) (*ModelInfo, error)GET/v1/models/{model_id}
Get a specific model.
Download File
client.Files.Download(ctx, fileID, query) (*Response, error)GET/v1/files/{file_id}/content
Get File Metadata
client.Files.GetMetadata(ctx, fileID, query) (*FileMetadata, error)GET/v1/files/{file_id}
Delete Skill
client.Skills.Delete(ctx, skillID, body) (*DeletedSkill, error)DELETE/v1/skills/{skill_id}
Get Current Organization
client.Organization.Get(ctx) (*OrganizationInfo, error)GET/v1/organizations/me
Retrieve information about the organization associated with the authenticated API key.