|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > !API-Key Tester for CURL-Command > !API-Key Tester for DeepSeek AI using CURL |
To test the validity of your DeepSeek AI API key aside from using SPR, you can use CURL.
1. Insert your DeepSeek AI API key into the SPR script below at the `$$KEY` variable.
2. Run this SPR script.
It will generate a CURL command-line script and copy it to the clipboard.
3. Open a Command Prompt (CMD) console, paste the clipboard contents, and press "ENTER" to execute.
' Insert your API key here (replace the example key):
$$KEY=sk-deepseek-example-key-1234567890abcdef
' Start building the curl command
$$TTX=curl -X POST https://api.deepseek.com/v1/chat/completions
' Add Authorization header with Bearer and $$KEY
$$TTX+ -H "Authorization: Bearer $$KEY"
' Add Content-Type header
$$TTX+ -H "Content-Type: application/json"
' Add the JSON payload (escaped for CMD compatibility)
$$TTX+ -d "{\"model\": \"deepseek-chat\", \"messages\": [{\"role\": \"user\", \"content\": \"
$$TTX+Hello, are you there?\"}]}"
' Copy the constructed command to the clipboard
CLB.Set Ansi Text|$$TTX
' End script
ENR.

Running the generated CURL script from the clipboard in a CMD console will display this result if the API key is valid.