Files
orca/misc/test/completion.sh
Zheng Kai 911c1b9f5f up
2023-08-21 10:49:03 +08:00

14 lines
339 B
Bash
Executable File

#!/bin/bash -ex
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl "${BASE}/completions" \
-w "Total time: %{time_total} seconds\n" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{
"model": "text-davinci-003",
"prompt": "Say this is a test",
"max_tokens": 7,
"temperature": 0
}'