Helicone Community Page

Updated last year

Using Azure OpenAI via CURL

We're trying to use Azure OpenAI via CURL

Can you help what's wrong - as I can't find CURL examples in doc

Plain Text
curl --request POST \
  --url https://oai.hconeai.com/openai/deployments/DEPLOYMENTNAME/chat/completions \
  --header 'Helicone-Auth: Bearer HELICONE_KEY' \
  --header 'Helicone-OpenAI-Api-Base: https://AZUREDOMAIN.openai.azure.com' \
  --header 'api-key: AZURE_API_KEY' \
  --header 'content-type: application/json' \
  --data '{
    "messages": [
      {
        role: "system",
        content: "System Prompt"
      },
      {
        role: "user",
        content: "Answer in one word"
      }],
    "max_tokens": 800,
    "temperature": 1,
    "model": "gpt-3.5-turbo-0613"
  }'
J
C
4 comments
Hi @Saurabh This should work correctly. We can help you debug shortly
@Saurabh I have been testing and I believe you need to add the query string parameter for the apiVersion:

https://oai.hconeai.com/openai/deployments/DEPLOYMENTNAME/chat/completions?api-version=VERSION
Docs have been updated to contain multiple examples: https://docs.helicone.ai/getting-started/integration-method/azure
Add a reply
Sign up and join the conversation on Discord