chatterchatControls.html9 matches
72<p class="text-xs text-gray-500 mb-3"></p>
73<div class="mb-4">
74<div x-show="!userApiKey" class="space-y-2">
75<label class="block text-xs text-gray-600">API Key <a href="https://console.groq.com/keys" target="_blank" class="underline hover:text-gray-600 dark:text-gray-800">(get key)</a></label>
76<div class="flex gap-2 items-center">
77<input type="password" x-model="apiKeyInput" placeholder="Enter your Groq API key..." class="flex-1 px-3 py-2 text-xs rounded-md focus:ring-2 focus:ring-blue-400 focus:border-transparent border-0 bg-white">
78<button type="button" @click="setApiKey()" :disabled="!apiKeyInput.trim()" class="px-3 py-2 bg-blue-600 text-white text-xs rounded-md hover:bg-blue-700 disabled:opacity-50">Set</button>
79</div>
80</div>
81<div x-show="userApiKey" class="space-y-2">
82<label class="block text-xs text-gray-600">API Key <a href="https://console.groq.com/keys" target="_blank" class="underline hover:text-gray-600 dark:text-gray-800">(get key)</a></label>
83<div class="flex items-center justify-between gap-2">
84<code class="text-[11px] px-2 py-1 bg-white border border-gray-200 rounded truncate max-w-[70%]" x-text="maskedApiKey"></code>
85<div class="flex gap-2">
86<button type="button" @click="changeApiKey()" class="text-[11px] hover:text-gray-700 underline">Change</button>
87<button type="button" @click="clearApiKey()" class="text-[11px] hover:text-gray-700 underline">Clear</button>
88</div>
89</div>
chatterchatCore.js2 matches
690if (!text) return;
691state.errorMessage = '';
692if (!state.hasServerKey && !state.userApiKey) {
693state.errorMessage = 'please add api key';
694return;
695}
chatterindex.html9 matches
249</p>
250<div class="mb-4">
251<div x-show="!userApiKey" class="space-y-2">
252<label class="block text-xs text-gray-600">API Key</label>
253<div class="flex gap-2 items-center">
254<input type="password" x-model="apiKeyInput" placeholder="Enter your Groq API key..." class="flex-1 px-3 py-2 text-xs rounded-md focus:ring-2 focus:ring-blue-400 focus:border-transparent border-0 bg-gray-50">
255<button type="button" @click="setApiKey()" :disabled="!apiKeyInput.trim()" class="px-3 py-2 bg-blue-600 text-white text-xs rounded-md hover:bg-blue-700 disabled:opacity-50">Set</button>
256</div>
257</div>
258<div x-show="userApiKey" class="space-y-2">
259<label class="block text-xs text-gray-600">API Key</label>
260<div class="flex items-center justify-between gap-2">
261<code class="text-[11px] px-2 py-1 bg-gray-50 border border-gray-200 rounded truncate max-w-[70%]" x-text="maskedApiKey"></code>
262<div class="flex gap-2">
263<button type="button" @click="changeApiKey()" class="text-[11px] hover:text-gray-700 underline">Change</button>
264<button type="button" @click="clearApiKey()" class="text-[11px] hover:text-gray-700 underline">Clear</button>
265</div>
266</div>
qbatindex.html1 match
82"imports": {
83"@atproto/oauth-client-browser": "https://esm.sh/@atproto/oauth-client-browser@0.3.15",
84"@atproto/api": "https://esm.sh/@atproto/api@0.15.5",
85"three": "https://esm.sh/three@0.180.0"
86}
37"imports": {
38"@atproto/oauth-client-browser": "npm:@atproto/oauth-client-browser@0.3.15",
39"@atproto/api": "npm:@atproto/api@0.15.5",
40"three": "npm:three@0.180.0"
41}
qbatbluesky-oauth.ts1 match
4OAuthSession,
5} from "https://esm.sh/@atproto/oauth-client-browser@0.3.15";
6import { Agent } from "https://esm.sh/@atproto/api@0.15.5";
78// OAuth client metadata - should match the backend configuration
weatherAppmain.tsx1 match
16useEffect(() => {
17async function fetchWeather() {
18const url = `https://api.open-meteo.com/v1/forecast?latitude=${city.lat}&longitude=${city.lon}¤t_weather=true`;
19const res = await fetch(url);
20const data = await res.json();
5<meta charset="UTF-8">
6<meta name="viewport" content="width=device-width, initial-scale=1.0">
7<title>NVIDIA API Client</title>
8<style>
9body {
121}
122
123.api-key-group {
124background: #fff3cd;
125border: 1px solid #ffeaa7;
129}
130
131.api-key-group label {
132color: #856404;
133}
161<div class="container">
162<div class="form-panel">
163<h1>NVIDIA API Client</h1>
164
165<form id="apiForm">
166<div class="api-key-group">
167<div class="form-group">
168<label for="apiKey">API Key:</label>
169<input type="password" id="apiKey" name="apiKey" placeholder="Enter your NVIDIA API key">
170</div>
171</div>
229<h2>Response</h2>
230<div id="responseContent" class="response-content">
231Click "Send Request" to see the API response here.
232</div>
233</div>
273errorHtml += '<strong>🌐 Network Error Troubleshooting:</strong>\\n';
274errorHtml += '• Check your internet connection\\n';
275errorHtml += '• Verify the API endpoint is accessible\\n';
276errorHtml += '• Check if CORS is blocking the request\\n';
277errorHtml += '• Ensure the server is running and reachable\\n';
331// Load saved values
332function loadSavedValues() {
333// Load API key from cookie
334const savedApiKey = getCookie('nvidia_api_key');
335if (savedApiKey) {
336document.getElementById('apiKey').value = savedApiKey;
337}
338362// Save current form values
363function saveCurrentValues() {
364const form = document.getElementById('apiForm');
365const formData = new FormData(form);
366const params = {};
367
368// Save API key to cookie
369const apiKey = formData.get('apiKey');
370if (apiKey) {
371setCookie('nvidia_api_key', apiKey);
372}
373374// Save other parameters to localStorage
375for (const [key, value] of formData.entries()) {
376if (key !== 'apiKey') {
377if (key === 'messages') {
378try {
397}
398399// Enhanced API request function
400async function makeApiRequest(requestData, apiKey) {
401const requestHeaders = {
402'Authorization': \`Bearer \${apiKey}\`,
403'Accept': 'application/json',
404'Content-Type': 'application/json'
406407try {
408const response = await fetch('https://integrate.api.nvidia.com/v1/chat/completions', {
409method: 'POST',
410headers: requestHeaders,
519520// Form submission handler with comprehensive error handling
521document.getElementById('apiForm').addEventListener('submit', async (e) => {
522e.preventDefault();
523
538// Get form data
539const formData = new FormData(e.target);
540const apiKey = formData.get('apiKey');
541
542if (!apiKey) {
543throw new Error('API Key is required');
544}
545
560saveCurrentValues();
561
562// Make API request
563const response = await makeApiRequest(requestData, apiKey);
564
565// Handle response based on streaming
1# NVIDIA API Client
23A plain vanilla HTML/JS/CSS web interface for making requests to the NVIDIA API chat completions endpoint.
45## Features
67- **Form Interface**: Clean, user-friendly form with all NVIDIA API parameters
8- **API Key Storage**: Securely stores API key in browser cookies for convenience
9- **Request Persistence**: Remembers last request parameters using localStorage
10- **Streaming Support**: Handles both streaming and non-streaming responses
11- **Real-time Response Display**: Shows API responses in real-time with proper formatting
12- **Error Handling**: Comprehensive error messages with detailed diagnostic information, troubleshooting guidance, and full request/response context
1316The interface includes all parameters from the original curl command:
1718- **API Key**: Your NVIDIA API key (stored in cookies)
19- **Model**: AI model to use (default: `openai/gpt-oss-20b`)
20- **Messages**: JSON array of conversation messages
29## Usage
30311. Enter your NVIDIA API key (will be saved for future use)
322. Modify any parameters as needed
333. Click "Send Request" to make the API call
344. View the response in the right panel
3540- Responsive two-column layout
41- Proper error handling and loading states
42- Cookie-based API key persistence
43- localStorage for form state persistence
4445## API Endpoint
4647Makes requests to: `https://integrate.api.nvidia.com/v1/chat/completions`
4849Equivalent to the provided curl command with all the same headers and data structure.