Skip to content

Groq API Curl Tutorial

DEPRECATION NOTICE

These APIs are now DEPRECATED! Please refer to the new documentation available at console.groq.com

Note, you need to be using at least curl v7.82.0 for these to work with --json, as well as jq. For use with older curl versions look here

curl -s -H"Authorization: Bearer ${APIKEY}" --json '{"model_id": "llama2-70b-4096", "system_prompt": "You are an unhelpful assistant", "user_prompt": "Are you a fish?"}' https://api.groq.com/v1/request_manager/text_completion | jq

Note Code-Llama is only available to select users at this time. If you are interested in testing Code-Llama, email us at api@groq.com.

curl -sq --keepalive-time 60 -H"Authorization: Bearer ${APIKEY}" --json '{"model_id": "codellama-34b", "system_prompt": "You are helpful and concise coding assitant", "user_prompt": "Write a beautiful blogging website in html/css"}' https://api.groq.com/v1/request_manager/text_completion | jq  -j ' .result.content'
curl -s -H"Authorization: Bearer ${APIKEY}" https://api.groq.com/v1/model_manager/models | jq