2023-12-17 18:53:55 +00:00
|
|
|
id: api-openai
|
|
|
|
|
|
|
|
info:
|
|
|
|
name: OpenAI API Test
|
|
|
|
author: geeknik
|
|
|
|
severity: info
|
|
|
|
reference:
|
|
|
|
- https://platform.openai.com/docs/api-reference
|
|
|
|
metadata:
|
2023-12-26 01:38:21 +00:00
|
|
|
verified: true
|
2024-01-14 13:49:27 +00:00
|
|
|
max-request: 1
|
2023-12-17 18:53:55 +00:00
|
|
|
tags: token-spray,openai
|
|
|
|
|
|
|
|
self-contained: true
|
|
|
|
|
|
|
|
http:
|
|
|
|
- method: POST
|
|
|
|
path:
|
2023-12-17 19:18:08 +00:00
|
|
|
- "https://api.openai.com/v1/chat/completions"
|
|
|
|
body: |
|
|
|
|
{
|
|
|
|
"model": "gpt-3.5-turbo",
|
|
|
|
"messages": [
|
|
|
|
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
|
|
|
|
{"role": "user", "content": "Who won the world series in 2020?"}
|
|
|
|
]
|
|
|
|
}
|
2023-12-17 18:53:55 +00:00
|
|
|
|
|
|
|
headers:
|
|
|
|
Content-Type: application/json
|
|
|
|
Authorization: Bearer {{token}}
|
2023-12-17 19:18:08 +00:00
|
|
|
|
|
|
|
matchers-condition: and
|
2023-12-17 18:53:55 +00:00
|
|
|
matchers:
|
2023-12-17 19:18:08 +00:00
|
|
|
- type: word
|
|
|
|
part: body
|
|
|
|
words:
|
|
|
|
- 'Los Angeles Dodgers'
|
2023-12-17 18:53:55 +00:00
|
|
|
- type: word
|
|
|
|
part: body
|
|
|
|
words:
|
|
|
|
- 'invalid_request_error'
|
|
|
|
- 'Incorrect API key'
|
|
|
|
- 'invalid_api_key'
|
|
|
|
condition: or
|
|
|
|
negative: true
|
2024-01-14 14:05:19 +00:00
|
|
|
# digest: 4a0a00473045022100993b6d83e2d38f838352e75144999ea35e4a32dd0a0ba2e8b58207165aae8eb602202af17d18cfa2448e608838333c5a06b1973a55dc898424203be5ce5a26a3583e:922c64590222798bb761d5b6d8e72950
|