Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Using fetch (native JavaScript)
- const response = await fetch('https://api.deepseek.com/chat/completions', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': 'Bearer <DeepSeek API Key>'
- },
- body: JSON.stringify({
- model: 'deepseek-chat',
- messages: [
- { role: 'system', content: 'You are a helpful assistant.' },
- { role: 'user', content: 'Hello!' }
- ],
- stream: false
- })
- });
- const data = await response.json();
- console.log(data);
Advertisement
Add Comment
Please, Sign In to add comment