integrate-api-nvidia-com-v1-chat-completions
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://curtcox--3cd55a00931311f0b22c0224a6c84d84.web.val.run
A plain vanilla HTML/JS/CSS web interface for making requests to the NVIDIA API chat completions endpoint.
- Form Interface: Clean, user-friendly form with all NVIDIA API parameters
- API Key Storage: Securely stores API key in browser cookies for convenience
- Request Persistence: Remembers last request parameters using localStorage
- Streaming Support: Handles both streaming and non-streaming responses
- Real-time Response Display: Shows API responses in real-time with proper formatting
- Error Handling: Comprehensive error messages with detailed diagnostic information, troubleshooting guidance, and full request/response context
The interface includes all parameters from the original curl command:
- API Key: Your NVIDIA API key (stored in cookies)
- Model: AI model to use (default:
openai/gpt-oss-20b
) - Messages: JSON array of conversation messages
- Temperature: Controls randomness (0-2, default: 1)
- Top P: Controls diversity (0-1, default: 1)
- Frequency Penalty: Reduces repetition (-2 to 2, default: 0)
- Presence Penalty: Encourages new topics (-2 to 2, default: 0)
- Max Tokens: Maximum response length (default: 4096)
- Stream: Enable streaming responses (checkbox, default: checked)
- Reasoning Effort: Model reasoning level (low/medium/high, default: medium)
- Enter your NVIDIA API key (will be saved for future use)
- Modify any parameters as needed
- Click "Send Request" to make the API call
- View the response in the right panel
- Built with vanilla HTML, CSS, and JavaScript
- No external dependencies or frameworks
- Responsive two-column layout
- Proper error handling and loading states
- Cookie-based API key persistence
- localStorage for form state persistence
Makes requests to: https://integrate.api.nvidia.com/v1/chat/completions
Equivalent to the provided curl command with all the same headers and data structure.