Versions in this module Expand all Collapse all v0 v0.1.1 Nov 13, 2026 v0.1.0 Oct 10, 2026 Changes in this version + const CheckinURL + const KeysURL + const PlanURL + const Version + type APIError struct + Body []byte + Code string + ErrorID string + Message string + RetryAfter time.Duration + StatusCode int + func (e *APIError) Error() string + type Annotation struct + Type string + URLCitation *URLCitation + type AnswerResponse struct + Answer string + DailyLimit int + DailyUsed int + Query string + Sources []SearchResult + type AuthenticationError struct + func (e *AuthenticationError) Unwrap() error + type BadRequestError struct + func (e *BadRequestError) Unwrap() error + type ChatChoice struct + FinishReason string + Index int + Message ResponseMessage + type ChatCompletion struct + Choices []ChatChoice + Created int64 + ID string + Model string + Object string + Usage *Usage + type ChatCompletionChunk struct + Choices []ChunkChoice + Created int64 + ID string + Model string + Usage *Usage + type ChatCompletionParams struct + Extra map[string]any + FallbackModels []string + MaxTokens *int + Messages []Message + Model string + ReasoningEffort string + ResponseFormat any + Seed *int64 + Stop []string + Temperature *float64 + ToolChoice any + Tools []Tool + TopP *float64 + WebSearch map[string]any + type ChatCompletionStream struct + func (s *ChatCompletionStream) Close() error + func (s *ChatCompletionStream) Current() ChatCompletionChunk + func (s *ChatCompletionStream) Err() error + func (s *ChatCompletionStream) Next() bool + func (s *ChatCompletionStream) Text() string + type ChatService struct + Completions *CompletionsService + type CheckinRequiredError struct + func (e *CheckinRequiredError) CheckinURL() string + func (e *CheckinRequiredError) Unwrap() error + type ChunkChoice struct + Delta ChunkDelta + FinishReason string + Index int + type ChunkDelta struct + Annotations []Annotation + Content string + ReasoningContent string + Role string + ToolCalls []ChunkToolCall + type ChunkToolCall struct + Function ToolCallFunction + ID string + Index int + Type string + type Client struct + Chat *ChatService + Images *ImagesService + Models *ModelsService + Tasks *TasksService + Videos *VideosService + func NewClient(opts ...Option) (*Client, error) + func (c *Client) APIKey() string + func (c *Client) Answer(ctx context.Context, params SearchParams) (*AnswerResponse, error) + func (c *Client) BaseURL() string + func (c *Client) Search(ctx context.Context, params SearchParams) (*SearchResponse, error) + type CompletionsService struct + func (s *CompletionsService) New(ctx context.Context, params ChatCompletionParams) (*ChatCompletion, error) + func (s *CompletionsService) NewStreaming(ctx context.Context, params ChatCompletionParams) (*ChatCompletionStream, error) + func (s *CompletionsService) StreamText(ctx context.Context, params ChatCompletionParams, onText func(string) error) error + type ConcurrencyLimitError struct + func (e *ConcurrencyLimitError) Unwrap() error + type ConnectionError struct + Message string + func (e *ConnectionError) Error() string + type ContentFilterError struct + func (e *ContentFilterError) Unwrap() error + type ContentPart struct + ImageURL *ImageURL + Text string + Type string + type DailyLimitError struct + func (e *DailyLimitError) ResetsAt() time.Time + func (e *DailyLimitError) Unwrap() error + type EmailNotVerifiedError struct + func (e *EmailNotVerifiedError) Unwrap() error + type ImageGenerateParams struct + Image string + Model string + N int + Prompt string + ResponseFormat string + Size string + type ImageURL struct + Detail string + URL string + type ImagesNotSupportedError struct + func (e *ImagesNotSupportedError) Unwrap() error + type ImagesService struct + func (s *ImagesService) Generate(ctx context.Context, params ImageGenerateParams) (*Task, error) + type IncompleteKeyError struct + func (e *IncompleteKeyError) Unwrap() error + type InternalServerError struct + func (e *InternalServerError) Unwrap() error + type Message struct + Content any + Name string + Role string + ToolCallID string + ToolCalls []ToolCall + type Model struct + Created int64 + ID string + Object string + OwnedBy string + type ModelBusyError struct + func (e *ModelBusyError) Unwrap() error + type ModelNotFoundError struct + Suggestions []string + func (e *ModelNotFoundError) Unwrap() error + type ModelsService struct + func (s *ModelsService) List(ctx context.Context) ([]Model, error) + type NotFoundError struct + func (e *NotFoundError) Unwrap() error + type Option func(*Client) + func WithAPIKey(key string) Option + func WithBaseURL(base string) Option + func WithFallbackModels(models ...string) Option + func WithHTTPClient(hc *http.Client) Option + func WithHeader(key, value string) Option + func WithMaxConcurrency(n int) Option + func WithMaxRetries(n int) Option + func WithStreamTransport(on bool) Option + func WithTimeout(d time.Duration) Option + type PermissionDeniedError struct + func (e *PermissionDeniedError) Unwrap() error + type ProviderBudgetError struct + func (e *ProviderBudgetError) Unwrap() error + type RateLimitError struct + func (e *RateLimitError) Unwrap() error + type RequestTooLargeError struct + func (e *RequestTooLargeError) Unwrap() error + type ResponseMessage struct + Annotations []Annotation + Content string + ReasoningContent string + Role string + ToolCalls []ToolCall + type SearchParams struct + NumResults int + Query string + type SearchResponse struct + DailyLimit int + DailyUsed int + Query string + Results []SearchResult + Suggestions []string + type SearchResult struct + Highlights []string + PublishedDate string + Score float64 + Text string + Title string + URL string + type StreamInterruptedError struct + ErrorID string + Message string + Partial string + func (e *StreamInterruptedError) Error() string + type Task struct + CompletedAt int64 + ContentURL string + CreatedAt int64 + Data []TaskOutput + Error *TaskError + ExpiresAt int64 + ID string + Kind string + Model string + Object string + Status string + type TaskError struct + Code string + ErrorID string + Message string + type TaskFailedError struct + Code string + ErrorID string + Message string + Task *Task + func (e *TaskFailedError) Error() string + type TaskOutput struct + B64JSON string + URL string + type TasksService struct + func (s *TasksService) Content(ctx context.Context, id string, index int) ([]byte, error) + func (s *TasksService) Get(ctx context.Context, id string) (*Task, error) + func (s *TasksService) List(ctx context.Context, limit int) ([]Task, error) + func (s *TasksService) Wait(ctx context.Context, id string, opts WaitOptions) (*Task, error) + type Tool struct + Function ToolFunction + Type string + type ToolCall struct + Function ToolCallFunction + ID string + Type string + type ToolCallFunction struct + Arguments string + Name string + type ToolFunction struct + Description string + Name string + Parameters map[string]any + type URLCitation struct + Title string + URL string + type Usage struct + CompletionTokens int + PromptTokens int + TotalTokens int + type VideoCreateParams struct + InputReference string + Model string + Prompt string + Seconds string + Size string + type VideosService struct + func (s *VideosService) Create(ctx context.Context, params VideoCreateParams) (*Task, error) + type WaitOptions struct + PollInterval time.Duration + Timeout time.Duration