Advertisement
A_GUES

Bash ChatGPT

Jul 29th, 2023
1,590
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. API_KEY="your-api-key"
  4. MODEL="text-davinci-002"
  5. PROMPT="Your prompt here"
  6.  
  7. curl -X POST "https://api.openai.com/v1/engines/$MODEL/completions" \
  8. -H "Content-Type: application/json" \
  9. -H "Authorization: Bearer $API_KEY" \
  10. -d @<(cat <<EOF
  11. {
  12.   "prompt": "$PROMPT",
  13.   "max_tokens": 60
  14. }
  15. EOF
  16. )
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement