nuclei-templates/http/token-spray/api-openai.yaml

47 lines
1.2 KiB
YAML

id: api-openai
info:
name: OpenAI API Test
author: geeknik
severity: info
reference:
- https://platform.openai.com/docs/api-reference
metadata:
verified: true
max-request: 1
tags: token-spray,openai
self-contained: true
http:
- method: POST
path:
- "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?"}
]
}
headers:
Content-Type: application/json
Authorization: Bearer {{token}}
matchers-condition: and
matchers:
- type: word
part: body
words:
- 'Los Angeles Dodgers'
- type: word
part: body
words:
- 'invalid_request_error'
- 'Incorrect API key'
- 'invalid_api_key'
condition: or
negative: true
# digest: 4a0a00473045022100993b6d83e2d38f838352e75144999ea35e4a32dd0a0ba2e8b58207165aae8eb602202af17d18cfa2448e608838333c5a06b1973a55dc898424203be5ce5a26a3583e:922c64590222798bb761d5b6d8e72950