-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenai.go
More file actions
69 lines (54 loc) · 2.35 KB
/
Copy pathopenai.go
File metadata and controls
69 lines (54 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Auto-generated by claw402 codegen — DO NOT EDIT
// Provider: OpenAI (openai)
package claw402
import (
"context"
"encoding/json"
)
// OpenaiOpenai provides methods for Openai openai endpoints.
type OpenaiOpenai struct {
client *Client
}
// Chat completions with GPT-5.4 (flagship, 1M context) — $0.05/call
func (r *OpenaiOpenai) Chat54(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/chat/5.4", body)
}
// Chat completions with GPT-5.4 Pro (highest precision) — $0.50/call
func (r *OpenaiOpenai) Chat54Pro(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/chat/5.4-pro", body)
}
// Chat completions with GPT-5.3 Instant (fast, great value) — $0.01/call
func (r *OpenaiOpenai) Chat53(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/chat/5.3", body)
}
// Chat completions with GPT-5-mini (fastest, cheapest) — $0.005/call
func (r *OpenaiOpenai) Chat5Mini(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/chat/5-mini", body)
}
// Text embeddings with text-embedding-3-small — $0.002/call
func (r *OpenaiOpenai) Embeddings(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/embeddings", body)
}
// Text embeddings with text-embedding-3-large — $0.005/call
func (r *OpenaiOpenai) EmbeddingsLarge(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/embeddings/large", body)
}
// Image generation with GPT Image — $0.05/call
func (r *OpenaiOpenai) Images(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
return r.client.post(ctx, "/api/v1/ai/openai/images", body)
}
// List available models — $0.001/call
func (r *OpenaiOpenai) Models(ctx context.Context) (json.RawMessage, error) {
return r.client.get(ctx, "/api/v1/ai/openai/models", nil)
}
// OpenaiResource provides access to all OpenAI API endpoints.
type OpenaiResource struct {
client *Client
Openai *OpenaiOpenai
}
func newOpenaiResource(c *Client) *OpenaiResource {
return &OpenaiResource{
client: c,
Openai: &OpenaiOpenai{client: c},
}
}