Documentation
¶
Index ¶
- Constants
- func BuildCookieHeader(raw string) string
- func ExtractWorkspaceID(raw string) string
- type Client
- func (c *Client) APIType() []utils.APIType
- func (c *Client) ApplyReferralReward(ctx context.Context, workspaceID, referralID, authCookie string) error
- func (c *Client) Chat(req *api.Request) (*http.Response, error)
- func (c *Client) DiscoverAPIKeys(ctx context.Context, authCookie string) ([]DiscoveredAPIKey, error)
- func (c *Client) FetchQuota(ctx context.Context, workspaceID, authCookie string) (*Quota, error)
- func (c *Client) FirstWorkspaceAPIKey(ctx context.Context, workspaceID, authCookie string) (DiscoveredAPIKey, error)
- func (c *Client) HandlerType() utils.HandlerType
- func (c *Client) ListReferralRewards(ctx context.Context, workspaceID, authCookie string) (*ReferralRewards, error)
- func (c *Client) PrepareRequest(root *ast.Node, apiType utils.APIType, _ api.BackendOpts) (api.PreparedRequest, error)
- func (c *Client) ReplaceModel(body []byte, model string) []byte
- func (c *Client) SetSettingsProvider(provider settings.Provider)
- type DiscoveredAPIKey
- type Quota
- type ReferralReward
- type ReferralRewards
Constants ¶
View Source
const ( BaseURL = "https://opencode.ai/zen/go" ChatCompletionsPath = "/v1/chat/completions" ResponsesPath = "/v1/responses" MessagesPath = "/v1/messages" )
Variables ¶
This section is empty.
Functions ¶
func BuildCookieHeader ¶
func ExtractWorkspaceID ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ApplyReferralReward ¶
func (*Client) DiscoverAPIKeys ¶
func (*Client) FetchQuota ¶
func (*Client) FirstWorkspaceAPIKey ¶
func (*Client) HandlerType ¶
func (c *Client) HandlerType() utils.HandlerType
func (*Client) ListReferralRewards ¶
func (*Client) PrepareRequest ¶
func (c *Client) PrepareRequest(root *ast.Node, apiType utils.APIType, _ api.BackendOpts) (api.PreparedRequest, error)
func (*Client) SetSettingsProvider ¶
type DiscoveredAPIKey ¶
type Quota ¶
type Quota struct {
Quota5h float64 `json:"quota_5h"`
Quota7d float64 `json:"quota_7d"`
Quota1mo float64 `json:"quota_1mo"`
Reset5h time.Time `json:"reset_5h"`
Reset7d time.Time `json:"reset_7d"`
Reset1mo time.Time `json:"reset_1mo"`
AvailableRewards []ReferralReward `json:"available_rewards"`
RewardsTotalCents int `json:"rewards_total_cents"`
}
type ReferralReward ¶
type ReferralRewards ¶
type ReferralRewards struct {
Rewards []ReferralReward `json:"rewards"`
TotalCents int `json:"total_cents"`
}
Click to show internal directories.
Click to hide internal directories.