jvanmelckebeke

Untitled

Jul 24th, 2025
661
0
5 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Using fetch (native JavaScript)
  2. const response = await fetch('https://api.deepseek.com/chat/completions', {
  3.   method: 'POST',
  4.   headers: {
  5.     'Content-Type': 'application/json',
  6.     'Authorization': 'Bearer <DeepSeek API Key>'
  7.   },
  8.   body: JSON.stringify({
  9.     model: 'deepseek-chat',
  10.     messages: [
  11.       { role: 'system', content: 'You are a helpful assistant.' },
  12.       { role: 'user', content: 'Hello!' }
  13.     ],
  14.     stream: false
  15.   })
  16. });
  17.  
  18. const data = await response.json();
  19. console.log(data);
Advertisement
Add Comment
Please, Sign In to add comment