godzilla865 commited on
Commit
09b9584
·
1 Parent(s): b849929

feat: Add deployment configs and API documentation

Browse files
.gitignore CHANGED
@@ -4,8 +4,12 @@ cli-proxy-api
4
 
5
  # Configuration
6
  config.yaml
 
7
  .env
8
 
 
 
 
9
  # Generated content
10
  bin/*
11
  logs/*
 
4
 
5
  # Configuration
6
  config.yaml
7
+ config.prod.yaml
8
  .env
9
 
10
+ # Auth credentials (sensitive)
11
+ auth-credentials/
12
+
13
  # Generated content
14
  bin/*
15
  logs/*
API_DOCUMENTATION.md ADDED
@@ -0,0 +1,1012 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CLIProxyAPI - Complete API Documentation
2
+
3
+ > **Last Updated:** December 31, 2025
4
+
5
+ ---
6
+
7
+ ## 🌐 API Endpoint
8
+
9
+ ```
10
+ https://creative-magic-production-22f0.up.railway.app
11
+ ```
12
+ api key: sk-cItvhSBsi7KWnTDZqfFX5gzuVURodOL8pPj1CbyJreAk3HYG
13
+
14
+ ✅ **This is a permanent URL** - Your API is deployed to Fly.io and runs 24/7!
15
+
16
+ **Local Endpoint (for development):**
17
+ ```
18
+ http://localhost:8317
19
+ ```
20
+
21
+ ---
22
+
23
+ ## 🔐 Authentication
24
+
25
+ All API requests require an API key in the `Authorization` header.
26
+
27
+ ### Available API Keys
28
+
29
+ | API Key | Description |
30
+ |---------|-------------|
31
+ | `test-api-key-1` | Primary test key |
32
+ | `test-api-key-2` | Secondary test key |
33
+ | `test-api-key-3` | Tertiary test key |
34
+ | `new-test-key` | Additional test key |
35
+
36
+ ### Authentication Header
37
+
38
+ ```
39
+ Authorization: Bearer YOUR_API_KEY
40
+ ```
41
+
42
+ ---
43
+
44
+ ## 📚 API Endpoints
45
+
46
+ ### 1. List Models
47
+
48
+ Returns a list of all available models.
49
+
50
+ **Endpoint:** `GET /v1/models`
51
+
52
+ **Example:**
53
+ ```bash
54
+ curl https://creative-magic-production-22f0.up.railway.app/v1/models \
55
+ -H "Authorization: Bearer test-api-key-1"
56
+ ```
57
+
58
+ **Response:**
59
+ ```json
60
+ {
61
+ "object": "list",
62
+ "data": [
63
+ {
64
+ "id": "gemini-2.5-pro",
65
+ "object": "model",
66
+ "created": 1750118400,
67
+ "owned_by": "google"
68
+ },
69
+ ...
70
+ ]
71
+ }
72
+ ```
73
+
74
+ ---
75
+
76
+ ### 2. Chat Completions
77
+
78
+ Create a chat completion with any available model.
79
+
80
+ **Endpoint:** `POST /v1/chat/completions`
81
+
82
+ **Request Body:**
83
+ ```json
84
+ {
85
+ "model": "model-name",
86
+ "messages": [
87
+ {"role": "system", "content": "You are a helpful assistant."},
88
+ {"role": "user", "content": "Your message here"}
89
+ ],
90
+ "max_tokens": 1000,
91
+ "temperature": 0.7,
92
+ "stream": false
93
+ }
94
+ ```
95
+
96
+ **Parameters:**
97
+
98
+ | Parameter | Type | Required | Description |
99
+ |-----------|------|----------|-------------|
100
+ | `model` | string | ✅ | Model ID to use |
101
+ | `messages` | array | ✅ | Array of message objects |
102
+ | `max_tokens` | integer | ❌ | Maximum tokens in response |
103
+ | `temperature` | float | ❌ | Sampling temperature (0-2) |
104
+ | `stream` | boolean | ❌ | Enable streaming responses |
105
+ | `top_p` | float | ❌ | Nucleus sampling parameter |
106
+
107
+ ---
108
+
109
+ ## 🤖 Available Models (35 Total)
110
+
111
+ ---
112
+
113
+ ## Google Models
114
+
115
+ ### gemini-2.5-pro
116
+ **Provider:** Google | **Type:** Chat/Reasoning
117
+
118
+ The flagship Gemini 2.5 Pro model with advanced reasoning capabilities.
119
+
120
+ ```bash
121
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
122
+ -H "Authorization: Bearer test-api-key-1" \
123
+ -H "Content-Type: application/json" \
124
+ -d '{
125
+ "model": "gemini-2.5-pro",
126
+ "messages": [{"role": "user", "content": "Explain quantum computing in simple terms"}],
127
+ "max_tokens": 1000
128
+ }'
129
+ ```
130
+
131
+ **Python Example:**
132
+ ```python
133
+ import requests
134
+
135
+ response = requests.post(
136
+ "https://creative-magic-production-22f0.up.railway.app/v1/chat/completions",
137
+ headers={
138
+ "Authorization": "Bearer test-api-key-1",
139
+ "Content-Type": "application/json"
140
+ },
141
+ json={
142
+ "model": "gemini-2.5-pro",
143
+ "messages": [{"role": "user", "content": "Explain quantum computing in simple terms"}],
144
+ "max_tokens": 1000
145
+ }
146
+ )
147
+ print(response.json())
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Antigravity Models
153
+
154
+ ### gemini-2.5-flash
155
+ **Provider:** Antigravity | **Type:** Fast Chat
156
+
157
+ Fast and efficient Gemini 2.5 Flash model.
158
+
159
+ ```bash
160
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
161
+ -H "Authorization: Bearer test-api-key-1" \
162
+ -H "Content-Type: application/json" \
163
+ -d '{
164
+ "model": "gemini-2.5-flash",
165
+ "messages": [{"role": "user", "content": "Write a haiku about coding"}],
166
+ "max_tokens": 100
167
+ }'
168
+ ```
169
+
170
+ ---
171
+
172
+ ### gemini-2.5-flash-lite
173
+ **Provider:** Antigravity | **Type:** Lightweight Chat
174
+
175
+ Lightweight version of Gemini 2.5 Flash for cost-effective usage.
176
+
177
+ ```bash
178
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
179
+ -H "Authorization: Bearer test-api-key-1" \
180
+ -H "Content-Type: application/json" \
181
+ -d '{
182
+ "model": "gemini-2.5-flash-lite",
183
+ "messages": [{"role": "user", "content": "What is 2+2?"}],
184
+ "max_tokens": 50
185
+ }'
186
+ ```
187
+
188
+ ---
189
+
190
+ ### gemini-2.5-computer-use-preview-10-2025
191
+ **Provider:** Antigravity | **Type:** Computer Use
192
+
193
+ Gemini model with computer use capabilities for automation tasks.
194
+
195
+ ```bash
196
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
197
+ -H "Authorization: Bearer test-api-key-1" \
198
+ -H "Content-Type: application/json" \
199
+ -d '{
200
+ "model": "gemini-2.5-computer-use-preview-10-2025",
201
+ "messages": [{"role": "user", "content": "Describe how to automate a web form submission"}],
202
+ "max_tokens": 500
203
+ }'
204
+ ```
205
+
206
+ ---
207
+
208
+ ### gemini-3-pro-preview
209
+ **Provider:** Antigravity | **Type:** Next-Gen Chat
210
+
211
+ Preview of the next-generation Gemini 3 Pro model.
212
+
213
+ ```bash
214
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
215
+ -H "Authorization: Bearer test-api-key-1" \
216
+ -H "Content-Type: application/json" \
217
+ -d '{
218
+ "model": "gemini-3-pro-preview",
219
+ "messages": [{"role": "user", "content": "Write a complex algorithm to solve the traveling salesman problem"}],
220
+ "max_tokens": 2000
221
+ }'
222
+ ```
223
+
224
+ ---
225
+
226
+ ### gemini-3-flash-preview
227
+ **Provider:** Antigravity | **Type:** Next-Gen Fast Chat
228
+
229
+ Preview of the next-generation Gemini 3 Flash model.
230
+
231
+ ```bash
232
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
233
+ -H "Authorization: Bearer test-api-key-1" \
234
+ -H "Content-Type: application/json" \
235
+ -d '{
236
+ "model": "gemini-3-flash-preview",
237
+ "messages": [{"role": "user", "content": "Summarize the benefits of renewable energy"}],
238
+ "max_tokens": 500
239
+ }'
240
+ ```
241
+
242
+ ---
243
+
244
+ ### gemini-3-pro-image-preview
245
+ **Provider:** Antigravity | **Type:** Vision/Image
246
+
247
+ Gemini 3 Pro with image generation and understanding capabilities.
248
+
249
+ ```bash
250
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
251
+ -H "Authorization: Bearer test-api-key-1" \
252
+ -H "Content-Type: application/json" \
253
+ -d '{
254
+ "model": "gemini-3-pro-image-preview",
255
+ "messages": [{"role": "user", "content": "Describe what an AI-generated landscape would look like"}],
256
+ "max_tokens": 500
257
+ }'
258
+ ```
259
+
260
+ ---
261
+
262
+ ### gemini-claude-sonnet-4-5
263
+ **Provider:** Antigravity | **Type:** Hybrid Chat
264
+
265
+ Hybrid model combining Gemini and Claude Sonnet 4.5 capabilities.
266
+
267
+ ```bash
268
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
269
+ -H "Authorization: Bearer test-api-key-1" \
270
+ -H "Content-Type: application/json" \
271
+ -d '{
272
+ "model": "gemini-claude-sonnet-4-5",
273
+ "messages": [{"role": "user", "content": "Write a professional email to a client"}],
274
+ "max_tokens": 500
275
+ }'
276
+ ```
277
+
278
+ ---
279
+
280
+ ### gemini-claude-sonnet-4-5-thinking
281
+ **Provider:** Antigravity | **Type:** Hybrid Reasoning
282
+
283
+ Hybrid model with extended thinking/reasoning capabilities.
284
+
285
+ ```bash
286
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
287
+ -H "Authorization: Bearer test-api-key-1" \
288
+ -H "Content-Type: application/json" \
289
+ -d '{
290
+ "model": "gemini-claude-sonnet-4-5-thinking",
291
+ "messages": [{"role": "user", "content": "Solve this logic puzzle: If all bloops are razzles and all razzles are lazzles, are all bloops lazzles?"}],
292
+ "max_tokens": 1000
293
+ }'
294
+ ```
295
+
296
+ ---
297
+
298
+ ### gemini-claude-opus-4-5-thinking
299
+ **Provider:** Antigravity | **Type:** Premium Hybrid Reasoning
300
+
301
+ Premium hybrid model with Opus-level reasoning capabilities.
302
+
303
+ ```bash
304
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
305
+ -H "Authorization: Bearer test-api-key-1" \
306
+ -H "Content-Type: application/json" \
307
+ -d '{
308
+ "model": "gemini-claude-opus-4-5-thinking",
309
+ "messages": [{"role": "user", "content": "Analyze the philosophical implications of artificial consciousness"}],
310
+ "max_tokens": 2000
311
+ }'
312
+ ```
313
+
314
+ ---
315
+
316
+ ### gpt-oss-120b-medium
317
+ **Provider:** Antigravity | **Type:** Open Source LLM
318
+
319
+ 120 billion parameter open-source style model.
320
+
321
+ ```bash
322
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
323
+ -H "Authorization: Bearer test-api-key-1" \
324
+ -H "Content-Type: application/json" \
325
+ -d '{
326
+ "model": "gpt-oss-120b-medium",
327
+ "messages": [{"role": "user", "content": "Explain the difference between supervised and unsupervised learning"}],
328
+ "max_tokens": 1000
329
+ }'
330
+ ```
331
+
332
+ ---
333
+
334
+ ## Qwen Models
335
+
336
+ ### qwen3-32b
337
+ **Provider:** IFlow | **Type:** Chat
338
+
339
+ Qwen 3 32B parameter model for general chat.
340
+
341
+ ```bash
342
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
343
+ -H "Authorization: Bearer test-api-key-1" \
344
+ -H "Content-Type: application/json" \
345
+ -d '{
346
+ "model": "qwen3-32b",
347
+ "messages": [{"role": "user", "content": "Translate this to Chinese: Hello, how are you?"}],
348
+ "max_tokens": 100
349
+ }'
350
+ ```
351
+
352
+ ---
353
+
354
+ ### qwen3-235b
355
+ **Provider:** IFlow | **Type:** Large Chat
356
+
357
+ Qwen 3 235B parameter flagship model.
358
+
359
+ ```bash
360
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
361
+ -H "Authorization: Bearer test-api-key-1" \
362
+ -H "Content-Type: application/json" \
363
+ -d '{
364
+ "model": "qwen3-235b",
365
+ "messages": [{"role": "user", "content": "Write a detailed business plan for a tech startup"}],
366
+ "max_tokens": 2000
367
+ }'
368
+ ```
369
+
370
+ ---
371
+
372
+ ### qwen3-235b-a22b-instruct
373
+ **Provider:** IFlow | **Type:** Instruction-Tuned
374
+
375
+ Qwen 3 235B with instruction tuning for better task following.
376
+
377
+ ```bash
378
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
379
+ -H "Authorization: Bearer test-api-key-1" \
380
+ -H "Content-Type: application/json" \
381
+ -d '{
382
+ "model": "qwen3-235b-a22b-instruct",
383
+ "messages": [
384
+ {"role": "system", "content": "You are a helpful coding assistant."},
385
+ {"role": "user", "content": "Write a Python function to calculate factorial"}
386
+ ],
387
+ "max_tokens": 500
388
+ }'
389
+ ```
390
+
391
+ ---
392
+
393
+ ### qwen3-235b-a22b-thinking-2507
394
+ **Provider:** IFlow | **Type:** Reasoning
395
+
396
+ Qwen 3 235B with enhanced thinking/reasoning capabilities.
397
+
398
+ ```bash
399
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
400
+ -H "Authorization: Bearer test-api-key-1" \
401
+ -H "Content-Type: application/json" \
402
+ -d '{
403
+ "model": "qwen3-235b-a22b-thinking-2507",
404
+ "messages": [{"role": "user", "content": "Solve step by step: What is 17 * 23 + 45 / 9?"}],
405
+ "max_tokens": 500
406
+ }'
407
+ ```
408
+
409
+ ---
410
+
411
+ ### qwen3-max
412
+ **Provider:** IFlow | **Type:** Maximum Performance
413
+
414
+ Qwen 3 Max - highest performance configuration.
415
+
416
+ ```bash
417
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
418
+ -H "Authorization: Bearer test-api-key-1" \
419
+ -H "Content-Type: application/json" \
420
+ -d '{
421
+ "model": "qwen3-max",
422
+ "messages": [{"role": "user", "content": "Write a comprehensive essay on climate change"}],
423
+ "max_tokens": 3000
424
+ }'
425
+ ```
426
+
427
+ ---
428
+
429
+ ### qwen3-max-preview
430
+ **Provider:** IFlow | **Type:** Preview
431
+
432
+ Preview version of Qwen 3 Max with latest features.
433
+
434
+ ```bash
435
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
436
+ -H "Authorization: Bearer test-api-key-1" \
437
+ -H "Content-Type: application/json" \
438
+ -d '{
439
+ "model": "qwen3-max-preview",
440
+ "messages": [{"role": "user", "content": "What are the latest trends in AI?"}],
441
+ "max_tokens": 1000
442
+ }'
443
+ ```
444
+
445
+ ---
446
+
447
+ ### qwen3-vl-plus
448
+ **Provider:** IFlow | **Type:** Vision-Language
449
+
450
+ Qwen 3 Vision-Language model for multimodal tasks.
451
+
452
+ ```bash
453
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
454
+ -H "Authorization: Bearer test-api-key-1" \
455
+ -H "Content-Type: application/json" \
456
+ -d '{
457
+ "model": "qwen3-vl-plus",
458
+ "messages": [{"role": "user", "content": "Describe how image recognition works"}],
459
+ "max_tokens": 500
460
+ }'
461
+ ```
462
+
463
+ ---
464
+
465
+ ### qwen3-coder-plus
466
+ **Provider:** Qwen | **Type:** Code Generation
467
+
468
+ Specialized coding model for advanced programming tasks.
469
+
470
+ ```bash
471
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
472
+ -H "Authorization: Bearer test-api-key-1" \
473
+ -H "Content-Type: application/json" \
474
+ -d '{
475
+ "model": "qwen3-coder-plus",
476
+ "messages": [
477
+ {"role": "system", "content": "You are an expert programmer."},
478
+ {"role": "user", "content": "Write a REST API in Python using FastAPI with CRUD operations"}
479
+ ],
480
+ "max_tokens": 2000
481
+ }'
482
+ ```
483
+
484
+ ---
485
+
486
+ ### qwen3-coder-flash
487
+ **Provider:** Qwen | **Type:** Fast Code Generation
488
+
489
+ Fast coding model for quick code generation tasks.
490
+
491
+ ```bash
492
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
493
+ -H "Authorization: Bearer test-api-key-1" \
494
+ -H "Content-Type: application/json" \
495
+ -d '{
496
+ "model": "qwen3-coder-flash",
497
+ "messages": [{"role": "user", "content": "Write a JavaScript function to reverse a string"}],
498
+ "max_tokens": 300
499
+ }'
500
+ ```
501
+
502
+ ---
503
+
504
+ ### vision-model
505
+ **Provider:** Qwen | **Type:** Vision
506
+
507
+ Dedicated vision model for image understanding.
508
+
509
+ ```bash
510
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
511
+ -H "Authorization: Bearer test-api-key-1" \
512
+ -H "Content-Type: application/json" \
513
+ -d '{
514
+ "model": "vision-model",
515
+ "messages": [{"role": "user", "content": "Explain computer vision techniques"}],
516
+ "max_tokens": 500
517
+ }'
518
+ ```
519
+
520
+ ---
521
+
522
+ ## DeepSeek Models
523
+
524
+ ### deepseek-r1
525
+ **Provider:** IFlow | **Type:** Reasoning
526
+
527
+ DeepSeek R1 reasoning model for complex problem solving.
528
+
529
+ ```bash
530
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
531
+ -H "Authorization: Bearer test-api-key-1" \
532
+ -H "Content-Type: application/json" \
533
+ -d '{
534
+ "model": "deepseek-r1",
535
+ "messages": [{"role": "user", "content": "Prove that the square root of 2 is irrational"}],
536
+ "max_tokens": 1500
537
+ }'
538
+ ```
539
+
540
+ ---
541
+
542
+ ### deepseek-v3
543
+ **Provider:** IFlow | **Type:** Chat
544
+
545
+ DeepSeek V3 general chat model.
546
+
547
+ ```bash
548
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
549
+ -H "Authorization: Bearer test-api-key-1" \
550
+ -H "Content-Type: application/json" \
551
+ -d '{
552
+ "model": "deepseek-v3",
553
+ "messages": [{"role": "user", "content": "Explain blockchain technology"}],
554
+ "max_tokens": 1000
555
+ }'
556
+ ```
557
+
558
+ ---
559
+
560
+ ### deepseek-v3.1
561
+ **Provider:** IFlow | **Type:** Improved Chat
562
+
563
+ DeepSeek V3.1 with improved capabilities.
564
+
565
+ ```bash
566
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
567
+ -H "Authorization: Bearer test-api-key-1" \
568
+ -H "Content-Type: application/json" \
569
+ -d '{
570
+ "model": "deepseek-v3.1",
571
+ "messages": [{"role": "user", "content": "Compare SQL and NoSQL databases"}],
572
+ "max_tokens": 1000
573
+ }'
574
+ ```
575
+
576
+ ---
577
+
578
+ ### deepseek-v3.2
579
+ **Provider:** IFlow | **Type:** Latest Chat
580
+
581
+ DeepSeek V3.2 latest version with enhanced performance.
582
+
583
+ ```bash
584
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
585
+ -H "Authorization: Bearer test-api-key-1" \
586
+ -H "Content-Type: application/json" \
587
+ -d '{
588
+ "model": "deepseek-v3.2",
589
+ "messages": [{"role": "user", "content": "Write a microservices architecture design"}],
590
+ "max_tokens": 1500
591
+ }'
592
+ ```
593
+
594
+ ---
595
+
596
+ ### deepseek-v3.2-chat
597
+ **Provider:** IFlow | **Type:** Conversational
598
+
599
+ DeepSeek V3.2 optimized for conversational interactions.
600
+
601
+ ```bash
602
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
603
+ -H "Authorization: Bearer test-api-key-1" \
604
+ -H "Content-Type: application/json" \
605
+ -d '{
606
+ "model": "deepseek-v3.2-chat",
607
+ "messages": [
608
+ {"role": "user", "content": "Hi! Can you help me learn Python?"},
609
+ {"role": "assistant", "content": "Of course! I would be happy to help you learn Python. Where would you like to start?"},
610
+ {"role": "user", "content": "Let us start with variables and data types"}
611
+ ],
612
+ "max_tokens": 1000
613
+ }'
614
+ ```
615
+
616
+ ---
617
+
618
+ ### deepseek-v3.2-reasoner
619
+ **Provider:** IFlow | **Type:** Advanced Reasoning
620
+
621
+ DeepSeek V3.2 with specialized reasoning capabilities.
622
+
623
+ ```bash
624
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
625
+ -H "Authorization: Bearer test-api-key-1" \
626
+ -H "Content-Type: application/json" \
627
+ -d '{
628
+ "model": "deepseek-v3.2-reasoner",
629
+ "messages": [{"role": "user", "content": "A farmer has 17 sheep. All but 9 die. How many are left?"}],
630
+ "max_tokens": 500
631
+ }'
632
+ ```
633
+
634
+ ---
635
+
636
+ ## Kimi Models
637
+
638
+ ### kimi-k2
639
+ **Provider:** IFlow | **Type:** Chat
640
+
641
+ Kimi K2 general purpose model.
642
+
643
+ ```bash
644
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
645
+ -H "Authorization: Bearer test-api-key-1" \
646
+ -H "Content-Type: application/json" \
647
+ -d '{
648
+ "model": "kimi-k2",
649
+ "messages": [{"role": "user", "content": "Write a poem about the ocean"}],
650
+ "max_tokens": 300
651
+ }'
652
+ ```
653
+
654
+ ---
655
+
656
+ ### kimi-k2-0905
657
+ **Provider:** IFlow | **Type:** Updated Chat
658
+
659
+ Kimi K2 September 2025 update with improvements.
660
+
661
+ ```bash
662
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
663
+ -H "Authorization: Bearer test-api-key-1" \
664
+ -H "Content-Type: application/json" \
665
+ -d '{
666
+ "model": "kimi-k2-0905",
667
+ "messages": [{"role": "user", "content": "Summarize the key features of Python 3.12"}],
668
+ "max_tokens": 500
669
+ }'
670
+ ```
671
+
672
+ ---
673
+
674
+ ### kimi-k2-thinking
675
+ **Provider:** IFlow | **Type:** Reasoning
676
+
677
+ Kimi K2 with extended thinking capabilities.
678
+
679
+ ```bash
680
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
681
+ -H "Authorization: Bearer test-api-key-1" \
682
+ -H "Content-Type: application/json" \
683
+ -d '{
684
+ "model": "kimi-k2-thinking",
685
+ "messages": [{"role": "user", "content": "If I have 3 boxes, each containing 2 red balls and 3 blue balls, what is the probability of drawing a red ball from a randomly chosen box?"}],
686
+ "max_tokens": 800
687
+ }'
688
+ ```
689
+
690
+ ---
691
+
692
+ ## MiniMax Models
693
+
694
+ ### minimax-m2
695
+ **Provider:** IFlow | **Type:** Chat
696
+
697
+ MiniMax M2 efficient chat model.
698
+
699
+ ```bash
700
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
701
+ -H "Authorization: Bearer test-api-key-1" \
702
+ -H "Content-Type: application/json" \
703
+ -d '{
704
+ "model": "minimax-m2",
705
+ "messages": [{"role": "user", "content": "Write a short story about a robot"}],
706
+ "max_tokens": 500
707
+ }'
708
+ ```
709
+
710
+ ---
711
+
712
+ ### minimax-m2.1
713
+ **Provider:** IFlow | **Type:** Improved Chat
714
+
715
+ MiniMax M2.1 with enhanced capabilities.
716
+
717
+ ```bash
718
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
719
+ -H "Authorization: Bearer test-api-key-1" \
720
+ -H "Content-Type: application/json" \
721
+ -d '{
722
+ "model": "minimax-m2.1",
723
+ "messages": [{"role": "user", "content": "Explain machine learning to a 10-year-old"}],
724
+ "max_tokens": 400
725
+ }'
726
+ ```
727
+
728
+ ---
729
+
730
+ ## GLM Models
731
+
732
+ ### glm-4.6
733
+ **Provider:** IFlow | **Type:** Chat
734
+
735
+ GLM 4.6 chat model from Zhipu AI.
736
+
737
+ ```bash
738
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
739
+ -H "Authorization: Bearer test-api-key-1" \
740
+ -H "Content-Type: application/json" \
741
+ -d '{
742
+ "model": "glm-4.6",
743
+ "messages": [{"role": "user", "content": "What is the history of artificial intelligence?"}],
744
+ "max_tokens": 1000
745
+ }'
746
+ ```
747
+
748
+ ---
749
+
750
+ ### glm-4.7
751
+ **Provider:** IFlow | **Type:** Latest Chat
752
+
753
+ GLM 4.7 latest version with improved performance.
754
+
755
+ ```bash
756
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
757
+ -H "Authorization: Bearer test-api-key-1" \
758
+ -H "Content-Type: application/json" \
759
+ -d '{
760
+ "model": "glm-4.7",
761
+ "messages": [{"role": "user", "content": "Design a database schema for an e-commerce platform"}],
762
+ "max_tokens": 1500
763
+ }'
764
+ ```
765
+
766
+ ---
767
+
768
+ ## Other Models
769
+
770
+ ### tstars2.0
771
+ **Provider:** IFlow | **Type:** Specialized
772
+
773
+ TStars 2.0 specialized model.
774
+
775
+ ```bash
776
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
777
+ -H "Authorization: Bearer test-api-key-1" \
778
+ -H "Content-Type: application/json" \
779
+ -d '{
780
+ "model": "tstars2.0",
781
+ "messages": [{"role": "user", "content": "What are best practices for software testing?"}],
782
+ "max_tokens": 800
783
+ }'
784
+ ```
785
+
786
+ ---
787
+
788
+ ## 🔄 Streaming Responses
789
+
790
+ Enable streaming for real-time token-by-token responses:
791
+
792
+ ```bash
793
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
794
+ -H "Authorization: Bearer test-api-key-1" \
795
+ -H "Content-Type: application/json" \
796
+ -d '{
797
+ "model": "gemini-2.5-pro",
798
+ "messages": [{"role": "user", "content": "Write a long story about space exploration"}],
799
+ "max_tokens": 2000,
800
+ "stream": true
801
+ }'
802
+ ```
803
+
804
+ **Python Streaming Example:**
805
+ ```python
806
+ import requests
807
+
808
+ response = requests.post(
809
+ "https://creative-magic-production-22f0.up.railway.app/v1/chat/completions",
810
+ headers={
811
+ "Authorization": "Bearer test-api-key-1",
812
+ "Content-Type": "application/json"
813
+ },
814
+ json={
815
+ "model": "gemini-2.5-pro",
816
+ "messages": [{"role": "user", "content": "Write a long story"}],
817
+ "stream": True
818
+ },
819
+ stream=True
820
+ )
821
+
822
+ for line in response.iter_lines():
823
+ if line:
824
+ print(line.decode('utf-8'))
825
+ ```
826
+
827
+ ---
828
+
829
+ ## 🐍 Python SDK Example
830
+
831
+ ```python
832
+ import openai
833
+
834
+ # Configure the client
835
+ client = openai.OpenAI(
836
+ api_key="test-api-key-1",
837
+ base_url="https://creative-magic-production-22f0.up.railway.app/v1"
838
+ )
839
+
840
+ # Chat completion
841
+ response = client.chat.completions.create(
842
+ model="gemini-2.5-pro",
843
+ messages=[
844
+ {"role": "system", "content": "You are a helpful assistant."},
845
+ {"role": "user", "content": "Hello!"}
846
+ ]
847
+ )
848
+
849
+ print(response.choices[0].message.content)
850
+ ```
851
+
852
+ ---
853
+
854
+ ## 📦 Node.js Example
855
+
856
+ ```javascript
857
+ import OpenAI from 'openai';
858
+
859
+ const client = new OpenAI({
860
+ apiKey: 'test-api-key-1',
861
+ baseURL: 'https://creative-magic-production-22f0.up.railway.app/v1'
862
+ });
863
+
864
+ async function main() {
865
+ const response = await client.chat.completions.create({
866
+ model: 'gemini-2.5-pro',
867
+ messages: [
868
+ { role: 'system', content: 'You are a helpful assistant.' },
869
+ { role: 'user', content: 'Hello!' }
870
+ ]
871
+ });
872
+
873
+ console.log(response.choices[0].message.content);
874
+ }
875
+
876
+ main();
877
+ ```
878
+
879
+ ---
880
+
881
+ ## 🔧 cURL Quick Reference
882
+
883
+ ### Basic Chat
884
+ ```bash
885
+ curl -X POST https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
886
+ -H "Authorization: Bearer test-api-key-1" \
887
+ -H "Content-Type: application/json" \
888
+ -d '{"model": "MODEL_NAME", "messages": [{"role": "user", "content": "YOUR_MESSAGE"}]}'
889
+ ```
890
+
891
+ ### With System Prompt
892
+ ```bash
893
+ curl -X POST https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
894
+ -H "Authorization: Bearer test-api-key-1" \
895
+ -H "Content-Type: application/json" \
896
+ -d '{
897
+ "model": "MODEL_NAME",
898
+ "messages": [
899
+ {"role": "system", "content": "You are a helpful assistant."},
900
+ {"role": "user", "content": "YOUR_MESSAGE"}
901
+ ]
902
+ }'
903
+ ```
904
+
905
+ ### With Temperature Control
906
+ ```bash
907
+ curl -X POST https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
908
+ -H "Authorization: Bearer test-api-key-1" \
909
+ -H "Content-Type: application/json" \
910
+ -d '{
911
+ "model": "MODEL_NAME",
912
+ "messages": [{"role": "user", "content": "YOUR_MESSAGE"}],
913
+ "temperature": 0.7,
914
+ "max_tokens": 1000
915
+ }'
916
+ ```
917
+
918
+ ---
919
+
920
+ ## 📊 Model Summary Table
921
+
922
+ | Model | Provider | Type | Best For |
923
+ |-------|----------|------|----------|
924
+ | `gemini-2.5-pro` | Google | Reasoning | Complex tasks, analysis |
925
+ | `gemini-2.5-flash` | Antigravity | Fast | Quick responses |
926
+ | `gemini-2.5-flash-lite` | Antigravity | Lightweight | Cost-effective |
927
+ | `gemini-2.5-computer-use-preview-10-2025` | Antigravity | Computer Use | Automation |
928
+ | `gemini-3-pro-preview` | Antigravity | Next-Gen | Latest features |
929
+ | `gemini-3-flash-preview` | Antigravity | Next-Gen Fast | Fast + latest |
930
+ | `gemini-3-pro-image-preview` | Antigravity | Vision | Image tasks |
931
+ | `gemini-claude-sonnet-4-5` | Antigravity | Hybrid | Writing, chat |
932
+ | `gemini-claude-sonnet-4-5-thinking` | Antigravity | Hybrid Reasoning | Complex reasoning |
933
+ | `gemini-claude-opus-4-5-thinking` | Antigravity | Premium Reasoning | Maximum capability |
934
+ | `gpt-oss-120b-medium` | Antigravity | Open Source | General tasks |
935
+ | `qwen3-32b` | IFlow | Chat | General chat |
936
+ | `qwen3-235b` | IFlow | Large | Complex tasks |
937
+ | `qwen3-235b-a22b-instruct` | IFlow | Instruction | Task following |
938
+ | `qwen3-235b-a22b-thinking-2507` | IFlow | Reasoning | Math, logic |
939
+ | `qwen3-max` | IFlow | Maximum | Best performance |
940
+ | `qwen3-max-preview` | IFlow | Preview | Latest Qwen |
941
+ | `qwen3-vl-plus` | IFlow | Vision-Language | Multimodal |
942
+ | `qwen3-coder-plus` | Qwen | Coding | Advanced coding |
943
+ | `qwen3-coder-flash` | Qwen | Fast Coding | Quick code |
944
+ | `vision-model` | Qwen | Vision | Image understanding |
945
+ | `deepseek-r1` | IFlow | Reasoning | Math proofs |
946
+ | `deepseek-v3` | IFlow | Chat | General |
947
+ | `deepseek-v3.1` | IFlow | Improved | Better performance |
948
+ | `deepseek-v3.2` | IFlow | Latest | Best DeepSeek |
949
+ | `deepseek-v3.2-chat` | IFlow | Conversational | Dialogue |
950
+ | `deepseek-v3.2-reasoner` | IFlow | Reasoning | Logic puzzles |
951
+ | `kimi-k2` | IFlow | Chat | Creative writing |
952
+ | `kimi-k2-0905` | IFlow | Updated | September update |
953
+ | `kimi-k2-thinking` | IFlow | Reasoning | Problem solving |
954
+ | `minimax-m2` | IFlow | Chat | Efficient |
955
+ | `minimax-m2.1` | IFlow | Improved | Better MiniMax |
956
+ | `glm-4.6` | IFlow | Chat | Chinese/English |
957
+ | `glm-4.7` | IFlow | Latest | Best GLM |
958
+ | `tstars2.0` | IFlow | Specialized | Testing focus |
959
+
960
+ ---
961
+
962
+ ## ❌ Error Handling
963
+
964
+ ### Common Errors
965
+
966
+ | Status Code | Error | Solution |
967
+ |-------------|-------|----------|
968
+ | 401 | Unauthorized | Check your API key |
969
+ | 404 | Not Found | Check endpoint URL |
970
+ | 429 | Rate Limited | Wait and retry |
971
+ | 500 | Server Error | Retry or try different model |
972
+ | 503 | Service Unavailable | Model temporarily unavailable |
973
+
974
+ ### Error Response Format
975
+ ```json
976
+ {
977
+ "error": {
978
+ "type": "error_type",
979
+ "message": "Error description"
980
+ }
981
+ }
982
+ ```
983
+
984
+ ---
985
+
986
+ ## 🚀 Quick Start
987
+
988
+ 1. **Test the connection:**
989
+ ```bash
990
+ curl https://creative-magic-production-22f0.up.railway.app/v1/models \
991
+ -H "Authorization: Bearer test-api-key-1"
992
+ ```
993
+
994
+ 2. **Make your first chat:**
995
+ ```bash
996
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
997
+ -H "Authorization: Bearer test-api-key-1" \
998
+ -H "Content-Type: application/json" \
999
+ -d '{"model": "gemini-2.5-flash", "messages": [{"role": "user", "content": "Hello!"}]}'
1000
+ ```
1001
+
1002
+ 3. **Try a coding model:**
1003
+ ```bash
1004
+ curl https://creative-magic-production-22f0.up.railway.app/v1/chat/completions \
1005
+ -H "Authorization: Bearer test-api-key-1" \
1006
+ -H "Content-Type: application/json" \
1007
+ -d '{"model": "qwen3-coder-plus", "messages": [{"role": "user", "content": "Write hello world in 5 languages"}]}'
1008
+ ```
1009
+
1010
+ ---
1011
+
1012
+ **Happy coding! 🎉**
Dockerfile CHANGED
@@ -16,20 +16,22 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X 'main.Version=${VERSION
16
 
17
  FROM alpine:3.22.0
18
 
19
- RUN apk add --no-cache tzdata
20
 
21
- RUN mkdir /CLIProxyAPI
22
 
23
  COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
24
 
25
- COPY config.example.yaml /CLIProxyAPI/config.example.yaml
 
 
 
 
26
 
27
  WORKDIR /CLIProxyAPI
28
 
29
  EXPOSE 8317
30
 
31
- ENV TZ=Asia/Shanghai
32
-
33
- RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo "${TZ}" > /etc/timezone
34
 
35
- CMD ["./CLIProxyAPI"]
 
16
 
17
  FROM alpine:3.22.0
18
 
19
+ RUN apk add --no-cache tzdata ca-certificates
20
 
21
+ RUN mkdir -p /CLIProxyAPI/auth-credentials
22
 
23
  COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
24
 
25
+ # Copy production config as config.yaml
26
+ COPY config.prod.yaml /CLIProxyAPI/config.yaml
27
+
28
+ # Copy auth credentials
29
+ COPY auth-credentials/ /CLIProxyAPI/auth-credentials/
30
 
31
  WORKDIR /CLIProxyAPI
32
 
33
  EXPOSE 8317
34
 
35
+ ENV TZ=UTC
 
 
36
 
37
+ CMD ["./CLIProxyAPI"]
Dockerfile.bak ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM golang:1.24-alpine AS builder
2
+
3
+ WORKDIR /app
4
+
5
+ COPY go.mod go.sum ./
6
+
7
+ RUN go mod download
8
+
9
+ COPY . .
10
+
11
+ ARG VERSION=dev
12
+ ARG COMMIT=none
13
+ ARG BUILD_DATE=unknown
14
+
15
+ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X 'main.Version=${VERSION}' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" -o ./CLIProxyAPI ./cmd/server/
16
+
17
+ FROM alpine:3.22.0
18
+
19
+ RUN apk add --no-cache tzdata ca-certificates
20
+
21
+ RUN mkdir -p /CLIProxyAPI/auth-credentials
22
+
23
+ COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
24
+
25
+ # Copy production config as config.yaml
26
+ COPY config.prod.yaml /CLIProxyAPI/config.yaml
27
+
28
+ # Copy auth credentials
29
+ COPY auth-credentials/ /CLIProxyAPI/auth-credentials/
30
+
31
+ WORKDIR /CLIProxyAPI
32
+
33
+ EXPOSE 8317
34
+
35
+ ENV TZ=UTC
36
+
37
+ CMD ["./CLIProxyAPI"]
Dockerfile.fly ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM golang:1.24-alpine AS builder
2
+
3
+ WORKDIR /app
4
+
5
+ COPY go.mod go.sum ./
6
+
7
+ RUN go mod download
8
+
9
+ COPY . .
10
+
11
+ ARG VERSION=dev
12
+ ARG COMMIT=none
13
+ ARG BUILD_DATE=unknown
14
+
15
+ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X 'main.Version=${VERSION}' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" -o ./CLIProxyAPI ./cmd/server/
16
+
17
+ FROM alpine:3.22.0
18
+
19
+ RUN apk add --no-cache tzdata ca-certificates
20
+
21
+ RUN mkdir -p /CLIProxyAPI/auth-credentials
22
+
23
+ COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
24
+
25
+ # Copy production config as config.yaml
26
+ COPY config.prod.yaml /CLIProxyAPI/config.yaml
27
+
28
+ # Copy auth credentials
29
+ COPY auth-credentials/ /CLIProxyAPI/auth-credentials/
30
+
31
+ WORKDIR /CLIProxyAPI
32
+
33
+ EXPOSE 8317
34
+
35
+ ENV TZ=UTC
36
+
37
+ CMD ["./CLIProxyAPI"]
README_HF.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: CLIProxy API
3
+ emoji: 🚀
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: docker
7
+ app_port: 8317
8
+ ---
fly.toml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # fly.toml app configuration file generated for cliproxy-api on 2025-12-31T21:57:30+02:00
2
+ #
3
+ # See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4
+ #
5
+
6
+ app = 'cliproxy-api'
7
+ primary_region = 'ams'
8
+
9
+ [build]
10
+ dockerfile = 'Dockerfile.fly'
11
+
12
+ [http_service]
13
+ internal_port = 8317
14
+ force_https = true
15
+ auto_stop_machines = 'stop'
16
+ auto_start_machines = true
17
+ min_machines_running = 0
18
+ processes = ['app']
19
+
20
+ [[vm]]
21
+ memory = '256mb'
22
+ cpu_kind = 'shared'
23
+ cpus = 1
24
+ memory_mb = 256
internal/util/gemini_schema_test.go CHANGED
@@ -20,14 +20,20 @@ func TestCleanJSONSchemaForAntigravity_ConstToEnum(t *testing.T) {
20
  }
21
  }`
22
 
 
 
23
  expected := `{
24
  "type": "object",
25
  "properties": {
26
  "kind": {
27
  "type": "string",
28
  "enum": ["InsightVizNode"]
 
 
 
29
  }
30
- }
 
31
  }`
32
 
33
  result := CleanJSONSchemaForAntigravity(input)
@@ -120,6 +126,7 @@ func TestCleanJSONSchemaForAntigravity_AnyOfFlattening_SmartSelection(t *testing
120
  }
121
  }`
122
 
 
123
  expected := `{
124
  "type": "object",
125
  "properties": {
@@ -127,10 +134,14 @@ func TestCleanJSONSchemaForAntigravity_AnyOfFlattening_SmartSelection(t *testing
127
  "type": "object",
128
  "description": "Accepts: null | object",
129
  "properties": {
130
- "kind": { "type": "string" }
131
- }
132
- }
133
- }
 
 
 
 
134
  }`
135
 
136
  result := CleanJSONSchemaForAntigravity(input)
@@ -150,14 +161,17 @@ func TestCleanJSONSchemaForAntigravity_OneOfFlattening(t *testing.T) {
150
  }
151
  }`
152
 
 
153
  expected := `{
154
  "type": "object",
155
  "properties": {
156
  "config": {
157
  "type": "string",
158
  "description": "Accepts: string | integer"
159
- }
160
- }
 
 
161
  }`
162
 
163
  result := CleanJSONSchemaForAntigravity(input)
@@ -213,6 +227,7 @@ func TestCleanJSONSchemaForAntigravity_RefHandling(t *testing.T) {
213
  }`
214
 
215
  // After $ref is converted to placeholder object, empty schema placeholder is also added
 
216
  expected := `{
217
  "type": "object",
218
  "properties": {
@@ -226,8 +241,10 @@ func TestCleanJSONSchemaForAntigravity_RefHandling(t *testing.T) {
226
  }
227
  },
228
  "required": ["reason"]
229
- }
230
- }
 
 
231
  }`
232
 
233
  result := CleanJSONSchemaForAntigravity(input)
@@ -254,6 +271,7 @@ func TestCleanJSONSchemaForAntigravity_RefHandling_DescriptionEscaping(t *testin
254
  }`
255
 
256
  // After $ref is converted, empty schema placeholder is also added
 
257
  expected := `{
258
  "type": "object",
259
  "properties": {
@@ -267,8 +285,10 @@ func TestCleanJSONSchemaForAntigravity_RefHandling_DescriptionEscaping(t *testin
267
  }
268
  },
269
  "required": ["reason"]
270
- }
271
- }
 
 
272
  }`
273
 
274
  result := CleanJSONSchemaForAntigravity(input)
@@ -562,14 +582,17 @@ func TestCleanJSONSchemaForAntigravity_AnyOfFlattening_PreservesDescription(t *t
562
  }
563
  }`
564
 
 
565
  expected := `{
566
  "type": "object",
567
  "properties": {
568
  "config": {
569
  "type": "string",
570
  "description": "Parent desc (Child desc) (Accepts: string | integer)"
571
- }
572
- }
 
 
573
  }`
574
 
575
  result := CleanJSONSchemaForAntigravity(input)
 
20
  }
21
  }`
22
 
23
+ // Note: The placeholder "_" property is added because the schema has properties but no required fields
24
+ // This is needed for Claude VALIDATED mode
25
  expected := `{
26
  "type": "object",
27
  "properties": {
28
  "kind": {
29
  "type": "string",
30
  "enum": ["InsightVizNode"]
31
+ },
32
+ "_": {
33
+ "type": "boolean"
34
  }
35
+ },
36
+ "required": ["_"]
37
  }`
38
 
39
  result := CleanJSONSchemaForAntigravity(input)
 
126
  }
127
  }`
128
 
129
+ // Note: The placeholder "_" property is added because the schema has properties but no required fields
130
  expected := `{
131
  "type": "object",
132
  "properties": {
 
134
  "type": "object",
135
  "description": "Accepts: null | object",
136
  "properties": {
137
+ "kind": { "type": "string" },
138
+ "_": { "type": "boolean" }
139
+ },
140
+ "required": ["_"]
141
+ },
142
+ "_": { "type": "boolean" }
143
+ },
144
+ "required": ["_"]
145
  }`
146
 
147
  result := CleanJSONSchemaForAntigravity(input)
 
161
  }
162
  }`
163
 
164
+ // Note: The placeholder "_" property is added because the schema has properties but no required fields
165
  expected := `{
166
  "type": "object",
167
  "properties": {
168
  "config": {
169
  "type": "string",
170
  "description": "Accepts: string | integer"
171
+ },
172
+ "_": { "type": "boolean" }
173
+ },
174
+ "required": ["_"]
175
  }`
176
 
177
  result := CleanJSONSchemaForAntigravity(input)
 
227
  }`
228
 
229
  // After $ref is converted to placeholder object, empty schema placeholder is also added
230
+ // Note: The top-level also gets "_" placeholder because it has properties but no required fields
231
  expected := `{
232
  "type": "object",
233
  "properties": {
 
241
  }
242
  },
243
  "required": ["reason"]
244
+ },
245
+ "_": { "type": "boolean" }
246
+ },
247
+ "required": ["_"]
248
  }`
249
 
250
  result := CleanJSONSchemaForAntigravity(input)
 
271
  }`
272
 
273
  // After $ref is converted, empty schema placeholder is also added
274
+ // Note: The top-level also gets "_" placeholder because it has properties but no required fields
275
  expected := `{
276
  "type": "object",
277
  "properties": {
 
285
  }
286
  },
287
  "required": ["reason"]
288
+ },
289
+ "_": { "type": "boolean" }
290
+ },
291
+ "required": ["_"]
292
  }`
293
 
294
  result := CleanJSONSchemaForAntigravity(input)
 
582
  }
583
  }`
584
 
585
+ // Note: The top-level also gets "_" placeholder because it has properties but no required fields
586
  expected := `{
587
  "type": "object",
588
  "properties": {
589
  "config": {
590
  "type": "string",
591
  "description": "Parent desc (Child desc) (Accepts: string | integer)"
592
+ },
593
+ "_": { "type": "boolean" }
594
+ },
595
+ "required": ["_"]
596
  }`
597
 
598
  result := CleanJSONSchemaForAntigravity(input)
internal/util/gemini_thinking.go CHANGED
@@ -275,9 +275,9 @@ func ApplyDefaultThinkingIfNeeded(model string, body []byte) []byte {
275
  }
276
  // Gemini 3 models use thinkingLevel instead of thinkingBudget
277
  if IsGemini3Model(model) {
278
- // Don't set a default - let the API use its dynamic default ("high")
279
- // Only set includeThoughts
280
- updated, _ := sjson.SetBytes(body, "generationConfig.thinkingConfig.includeThoughts", true)
281
  return updated
282
  }
283
  // Gemini 2.5 and other models use thinkingBudget
 
275
  }
276
  // Gemini 3 models use thinkingLevel instead of thinkingBudget
277
  if IsGemini3Model(model) {
278
+ // Set xhigh as the default thinking level for Gemini 3 Pro models
279
+ updated, _ := sjson.SetBytes(body, "generationConfig.thinkingConfig.thinkingLevel", "xhigh")
280
+ updated, _ = sjson.SetBytes(updated, "generationConfig.thinkingConfig.includeThoughts", true)
281
  return updated
282
  }
283
  // Gemini 2.5 and other models use thinkingBudget
render.yaml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ - type: web
3
+ name: cliproxy-api
4
+ runtime: docker
5
+ dockerfilePath: ./Dockerfile.fly
6
+ plan: free
7
+ envVars:
8
+ - key: TZ
9
+ value: UTC
10
+ healthCheckPath: /v1/models
start-public-tunnel.ps1 ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Start CLIProxyAPI with Cloudflare Tunnel
2
+ # This script exposes your API publicly via Cloudflare Tunnel
3
+
4
+ Write-Host "Starting CLIProxyAPI with Cloudflare Tunnel..." -ForegroundColor Cyan
5
+ Write-Host ""
6
+
7
+ # Cloudflared executable path
8
+ $cloudflared = "C:\Program Files (x86)\cloudflared\cloudflared.exe"
9
+
10
+ # Check if cloudflared exists
11
+ if (-not (Test-Path $cloudflared)) {
12
+ Write-Host "ERROR: cloudflared not found at $cloudflared" -ForegroundColor Red
13
+ Write-Host "Please install it with: winget install Cloudflare.cloudflared" -ForegroundColor Yellow
14
+ exit 1
15
+ }
16
+
17
+ # Start the tunnel
18
+ Write-Host "Creating Cloudflare Tunnel to http://localhost:8317..." -ForegroundColor Green
19
+ Write-Host "The public URL will be displayed below. Use it with your API keys:" -ForegroundColor Green
20
+ Write-Host ""
21
+ Write-Host "API Keys configured in config.yaml:" -ForegroundColor Yellow
22
+ Write-Host " - test-api-key-1" -ForegroundColor White
23
+ Write-Host " - test-api-key-2" -ForegroundColor White
24
+ Write-Host " - test-api-key-3" -ForegroundColor White
25
+ Write-Host " - new-test-key" -ForegroundColor White
26
+ Write-Host ""
27
+ Write-Host "Example usage:" -ForegroundColor Yellow
28
+ Write-Host ' curl https://<YOUR-TUNNEL-URL>/v1/models -H "Authorization: Bearer test-api-key-1"' -ForegroundColor White
29
+ Write-Host ""
30
+ Write-Host "Press Ctrl+C to stop the tunnel." -ForegroundColor Cyan
31
+ Write-Host "==========================================" -ForegroundColor Cyan
32
+
33
+ & $cloudflared tunnel --url http://localhost:8317 --protocol http2