LLM Inference API's Curls

MD
R
Markdown

Curl snippets to call inference APIs from terminal

=== ANTROPHIC ==== curl https://api.anthropic.com/v1/messages
-H "content-type: application/json"
-H "x-api-key: sk-ant-api03-***"
-H "anthropic-version: 2023-06-01"
-d '{ "model": "claude-3-sonnet-20240229", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Imagine you'''re learning about integrals for the first time. Explain what an integral is and how to solve a basic integral using the power rule. Give an example with a simple function like x^2." } ] }'

Created on 9/3/2024