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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>API Documentation | Vibecode Studio</title>
    <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔌</text></svg>">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#6366f1',
                        secondary: '#8b5cf6',
                        accent: '#ec4899',
                        dark: '#0f172a',
                        light: '#f8fafc'
                    }
                }
            }
        }
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        body {
            font-family: 'Inter', sans-serif;
            background-color: #0f172a;
        }
        .glow {
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
        }
        .feature-card:hover {
            transform: translateY(-5px);
            transition: all 0.3s ease;
        }
        .code-block {
            background: #1e293b;
            border-radius: 0.5rem;
            padding: 1rem;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 0.875rem;
            line-height: 1.5;
            overflow-x: auto;
        }
        .endpoint-card {
            transition: all 0.3s ease;
        }
        .endpoint-card:hover {
            transform: translateX(5px);
        }
        .tab-active {
            border-bottom: 2px solid #6366f1;
            color: #6366f1;
        }
    </style>
</head>
<body class="text-light">
    <!-- Navigation -->
    <nav class="fixed w-full z-50 bg-dark/90 backdrop-blur-sm py-4 px-6 flex justify-between items-center">
        <div class="flex items-center space-x-2">
            <div class="w-10 h-10 rounded-full bg-gradient-to-r from-primary to-accent flex items-center justify-center">
                <i data-feather="code" class="text-white"></i>
            </div>
            <span class="text-xl font-bold">Vibecode<span class="text-accent">Studio</span></span>
        </div>
        <div class="hidden md:flex space-x-8">
            <a href="index.html" class="hover:text-primary transition">Home</a>
            <a href="#" class="hover:text-primary transition">Features</a>
            <a href="#" class="hover:text-primary transition">API</a>
            <a href="chat.html" class="hover:text-primary transition">Chat</a>
        </div>
        <div class="flex items-center space-x-4">
            <button class="px-4 py-2 rounded-lg bg-primary hover:bg-primary/80 transition">Get Started</button>
            <button id="menu-toggle" class="md:hidden text-light">
                <i data-feather="menu"></i>
            </button>
        </div>
    </nav>

    <!-- Hero Section -->
    <section class="pt-24 pb-12">
        <div class="container mx-auto px-6">
            <div class="text-center max-w-3xl mx-auto">
                <h1 class="text-4xl md:text-5xl font-bold mb-6">
                    Powerful <span class="text-primary">API</span> Integration
                </h1>
                <p class="text-xl text-gray-300 mb-8">
                    Integrate Vibecode Studio into your applications with our comprehensive API. 
                    Generate code, create images, and convert text to speech programmatically.
                </p>
                <div class="flex flex-col sm:flex-row justify-center gap-4">
                    <button class="px-6 py-3 rounded-lg bg-primary hover:bg-primary/80 transition font-medium glow">
                        Get API Key
                    </button>
                    <button class="px-6 py-3 rounded-lg bg-dark border border-gray-700 hover:bg-gray-800 transition font-medium">
                        View Examples
                    </button>
                </div>
            </div>
        </div>
    </section>

    <!-- API Endpoints Section -->
    <section class="py-12 bg-dark/50">
        <div class="container mx-auto px-6">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">API <span class="text-primary">Endpoints</span></h2>
                <p class="text-gray-400 max-w-2xl mx-auto">
                    Explore our available API endpoints and their capabilities
                </p>
            </div>

            <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
                <!-- Endpoint 1 -->
                <div class="endpoint-card bg-dark border border-gray-800 rounded-2xl p-6">
                    <div class="flex items-start mb-4">
                        <div class="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center mr-3">
                            <i data-feather="message-square" class="text-primary"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">Chat Completion</h3>
                            <span class="text-sm bg-gray-800 text-gray-400 px-2 py-1 rounded">POST</span>
                        </div>
                    </div>
                    <p class="text-gray-400 mb-4">
                        Generate conversational AI responses with streaming support
                    </p>
                    <div class="text-sm font-mono bg-gray-900 p-3 rounded">
                        /openai/v1/chat/completions
                    </div>
                </div>

                <!-- Endpoint 2 -->
                <div class="endpoint-card bg-dark border border-gray-800 rounded-2xl p-6">
                    <div class="flex items-start mb-4">
                        <div class="w-10 h-10 rounded-lg bg-accent/10 flex items-center justify-center mr-3">
                            <i data-feather="image" class="text-accent"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">Image Generation</h3>
                            <span class="text-sm bg-gray-800 text-gray-400 px-2 py-1 rounded">GET</span>
                        </div>
                    </div>
                    <p class="text-gray-400 mb-4">
                        Create stunning images from text prompts
                    </p>
                    <div class="text-sm font-mono bg-gray-900 p-3 rounded">
                        /p/{prompt}
                    </div>
                </div>

                <!-- Endpoint 3 -->
                <div class="endpoint-card bg-dark border border-gray-800 rounded-2xl p-6">
                    <div class="flex items-start mb-4">
                        <div class="w-10 h-10 rounded-lg bg-secondary/10 flex items-center justify-center mr-3">
                            <i data-feather="mic" class="text-secondary"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">Text to Speech</h3>
                            <span class="text-sm bg-gray-800 text-gray-400 px-2 py-1 rounded">GET</span>
                        </div>
                    </div>
                    <p class="text-gray-400 mb-4">
                        Convert text to natural sounding speech
                    </p>
                    <div class="text-sm font-mono bg-gray-900 p-3 rounded">
                        /{prompt}
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- JavaScript SDK Section -->
    <section class="py-20">
        <div class="container mx-auto px-6">
            <div class="flex flex-col lg:flex-row items-center gap-12">
                <div class="lg:w-1/2">
                    <h2 class="text-3xl font-bold mb-6">
                        JavaScript <span class="text-primary">SDK</span>
                    </h2>
                    <p class="text-gray-400 mb-6">
                        Our JavaScript SDK makes it easy to integrate Vibecode Studio into your web applications.
                        With built-in support for streaming responses, image generation, and text-to-speech.
                    </p>
                    
                    <div class="flex space-x-4 mb-8">
                        <button id="sdk-tab" class="tab-active px-4 py-2 font-medium">SDK</button>
                        <button id="fetch-tab" class="px-4 py-2 font-medium">Fetch API</button>
                    </div>
                    
                    <ul class="space-y-4 mb-8">
                        <li class="flex items-start">
                            <i data-feather="check-circle" class="text-green-500 mt-1 mr-3"></i>
                            <span>Streaming chat completions</span>
                        </li>
                        <li class="flex items-start">
                            <i data-feather="check-circle" class="text-green-500 mt-1 mr-3"></i>
                            <span>Image generation with text prompts</span>
                        </li>
                        <li class="flex items-start">
                            <i data-feather="check-circle" class="text-green-500 mt-1 mr-3"></i>
                            <span>Text-to-speech conversion</span>
                        </li>
                        <li class="flex items-start">
                            <i data-feather="check-circle" class="text-green-500 mt-1 mr-3"></i>
                            <span>Promise-based async/await support</span>
                        </li>
                    </ul>
                    
                    <button class="px-6 py-3 rounded-lg bg-primary hover:bg-primary/80 transition font-medium">
                        Download SDK
                    </button>
                </div>
                
                <div class="lg:w-1/2 w-full">
                    <div class="bg-dark border border-gray-800 rounded-2xl p-6">
                        <div class="flex justify-between items-center mb-4">
                            <div class="text-sm text-gray-400">JavaScript Example</div>
                            <div class="flex space-x-2">
                                <button class="px-3 py-1 text-xs rounded bg-primary/10 text-primary">JavaScript</button>
                            </div>
                        </div>
                        <div class="code-block">
                            <pre class="text-blue-400"><span class="text-blue-400">import</span> { <span class="text-yellow-300">PollinationClient</span> } <span class="text-blue-400">from</span> <span class="text-green-400">'@vibecode/sdk'</span>;</pre>
                            <pre class="text-gray-400"></pre>
                            <pre class="text-blue-400"><span class="text-blue-400">const</span> client = <span class="text-yellow-300">new</span> <span class="text-yellow-300">PollinationClient</span>({</pre>
                            <pre class="text-blue-400">  apiKey: <span class="text-green-400">'your-api-key'</span></pre>
                            <pre class="text-blue-400">});</pre>
                            <pre class="text-gray-400"></pre>
                            <pre class="text-blue-400"><span class="text-blue-400">const</span> response = <span class="text-yellow-300">await</span> client.chatCompletion({</pre>
                            <pre class="text-blue-400">  messages: [{</pre>
                            <pre class="text-blue-400">    role: <span class="text-green-400">'user'</span>,</pre>
                            <pre class="text-blue-400">    content: <span class="text-green-400">'Create a responsive navbar with Tailwind'</span></pre>
                            <pre class="text-blue-400">  }],</pre>
                            <pre class="text-blue-400">  model: <span class="text-green-400">'gpt-4o'</span></pre>
                            <pre class="text-blue-400">});</pre>
                            <pre class="text-gray-400"></pre>
                            <pre class="text-blue-400"><span class="text-yellow-300">console</span>.<span class="text-yellow-300">log</span>(response.choices[0].message.content);</pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- API Examples Section -->
    <section class="py-20 bg-dark/50">
        <div class="container mx-auto px-6">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">API <span class="text-primary">Examples</span></h2>
                <p class="text-gray-400 max-w-2xl mx-auto">
                    See how easy it is to integrate Vibecode Studio into your applications
                </p>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <!-- Example 1 -->
                <div class="bg-dark border border-gray-800 rounded-2xl p-6">
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <i data-feather="message-circle" class="text-primary mr-2"></i>
                        Chat Completion
                    </h3>
                    <div class="code-block mb-4">
                        <pre class="text-blue-400"><span class="text-blue-400">const</span> response = <span class="text-yellow-300">await</span> fetch(<span class="text-green-400">'https://text.pollinations.ai/openai/v1/chat/completions'</span>, {</pre>
                        <pre class="text-blue-400">  method: <span class="text-green-400">'POST'</span>,</pre>
                        <pre class="text-blue-400">  headers: {</pre>
                        <pre class="text-blue-400">    <span class="text-green-400">'Content-Type'</span>: <span class="text-green-400">'application/json'</span></pre>
                        <pre class="text-blue-400">  },</pre>
                        <pre class="text-blue-400">  body: <span class="text-yellow-300">JSON</span>.<span class="text-yellow-300">stringify</span>({</pre>
                        <pre class="text-blue-400">    messages: [{</pre>
                        <pre class="text-blue-400">      role: <span class="text-green-400">'user'</span>,</pre>
                        <pre class="text-blue-400">      content: <span class="text-green-400">'Explain quantum computing in simple terms'</span></pre>
                        <pre class="text-blue-400">    }]</pre>
                        <pre class="text-blue-400">  })</pre>
                        <pre class="text-blue-400">});</pre>
                    </div>
                    <p class="text-gray-400">
                        Generate conversational AI responses with our chat completion endpoint.
                    </p>
                </div>
                
                <!-- Example 2 -->
                <div class="bg-dark border border-gray-800 rounded-2xl p-6">
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <i data-feather="image" class="text-accent mr-2"></i>
                        Image Generation
                    </h3>
                    <div class="code-block mb-4">
                        <pre class="text-blue-400"><span class="text-blue-400">const</span> imageUrl = <span class="text-green-400">'https://pollinations.ai/p/A beautiful sunset?model=flux&width=1024&height=1024'</span>;</pre>
                        <pre class="text-gray-400"></pre>
                        <pre class="text-blue-400"><span class="text-blue-400">const</span> response = <span class="text-yellow-300">await</span> fetch(imageUrl);</pre>
                        <pre class="text-blue-400"><span class="text-blue-400">const</span> imageBlob = <span class="text-yellow-300">await</span> response.blob();</pre>
                        <pre class="text-gray-400"></pre>
                        <pre class="text-blue-400"><span class="text-blue-400">const</span> imageUrl = <span class="text-yellow-300">URL</span>.<span class="text-yellow-300">createObjectURL</span>(imageBlob);</pre>
                        <pre class="text-blue-400"><span class="text-yellow-300">document</span>.<span class="text-yellow-300">getElementById</span>(<span class="text-green-400">'image'</span>).src = imageUrl;</pre>
                    </div>
                    <p class="text-gray-400">
                        Create stunning images from text prompts with our image generation API.
                    </p>
                </div>
            </div>
        </div>
    </section>

    <!-- CTA Section -->
    <section class="py-20">
        <div class="container mx-auto px-6 text-center">
            <h2 class="text-3xl md:text-4xl font-bold mb-6">
                Start Building with <span class="text-primary">Vibecode API</span>
            </h2>
            <p class="text-gray-400 max-w-2xl mx-auto mb-8">
                Get your API key and start integrating powerful AI capabilities into your applications today.
            </p>
            <div class="flex flex-col sm:flex-row justify-center space-y-4 sm:space-y-0 sm:space-x-4">
                <button class="px-8 py-3 rounded-lg bg-primary hover:bg-primary/80 transition font-medium glow">
                    Get API Key
                </button>
                <button class="px-8 py-3 rounded-lg bg-dark border border-gray-700 hover:bg-gray-800 transition font-medium">
                    View Documentation
                </button>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="py-12 bg-dark border-t border-gray-800">
        <div class="container mx-auto px-6">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <div class="w-8 h-8 rounded-full bg-gradient-to-r from-primary to-accent flex items-center justify-center">
                            <i data-feather="code" class="text-white w-4 h-4"></i>
                        </div>
                        <span class="text-xl font-bold">Vibecode<span class="text-accent">Studio</span></span>
                    </div>
                    <p class="text-gray-400">
                        Creative coding platform for developers and designers.
                    </p>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-4">Product</h4>
                    <ul class="space-y-2 text-gray-400">
                        <li><a href="index.html" class="hover:text-primary transition">Features</a></li>
                        <li><a href="#" class="hover:text-primary transition">API</a></li>
                        <li><a href="chat.html" class="hover:text-primary transition">Free Chat</a></li>
                        <li><a href="#" class="hover:text-primary transition">Documentation</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-4">Company</h4>
                    <ul class="space-y-2 text-gray-400">
                        <li><a href="#" class="hover:text-primary transition">About</a></li>
                        <li><a href="#" class="hover:text-primary transition">Blog</a></li>
                        <li><a href="#" class="hover:text-primary transition">Careers</a></li>
                        <li><a href="#" class="hover:text-primary transition">Contact</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-4">Connect</h4>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-primary transition">
                            <i data-feather="github"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-primary transition">
                            <i data-feather="twitter"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-primary transition">
                            <i data-feather="linkedin"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-primary transition">
                            <i data-feather="discord"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-12 pt-8 text-center text-gray-500">
                <p>&copy; 2023 Vibecode Studio. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Feather Icons
        feather.replace();
        
        // Tab switching
        document.getElementById('sdk-tab').addEventListener('click', function() {
            this.classList.add('tab-active');
            document.getElementById('fetch-tab').classList.remove('tab-active');
        });
        
        document.getElementById('fetch-tab').addEventListener('click', function() {
            this.classList.add('tab-active');
            document.getElementById('sdk-tab').classList.remove('tab-active');
        });
        
        // Mobile menu toggle
        document.getElementById('menu-toggle').addEventListener('click', function() {
            const menu = document.querySelector('.mobile-menu');
            menu.classList.toggle('hidden');
        });
    </script>
</body>
</html>