Skip to content

Instantly share code, notes, and snippets.

@huanlin
Last active October 14, 2023 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huanlin/6903e2139d805ee643a059a6a2a5840e to your computer and use it in GitHub Desktop.
Save huanlin/6903e2139d805ee643a059a6a2a5840e to your computer and use it in GitHub Desktop.
OpenAI API request example
@API_KEY = 0bc0xxxxxxxxxxxx7971
@RESOURCE_NAME = my-demo-ai-app
@DEPLOYMENT_ID = turbo-michael-35
### OpenAI Test
POST https://{{RESOURCE_NAME}}.openai.azure.com/openai/deployments/{{DEPLOYMENT_ID}}/chat/completions?api-version=2023-05-15
api-key: {{API_KEY}}
{
"messages": [
{ "role": "system", "content": "Please answer with Chinese."},
{ "role": "user", "content": "Tell me a joke about dogs."}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment