cURL and raw HTTP
Calling the Model API with cURL or any HTTP client.
- How do I call the Model API from Windows PowerShell?Use Invoke-RestMethod with a headers hashtable and a JSON body built by ConvertTo-Json.How-to
- How do I call the Model API with cURL?One POST to /v1/chat/completions with your key, your Account ID and a JSON body.How-to
- How do I call the Model API with HTTPie?HTTPie sends JSON by default; pass the two auth headers and the fields.How-to
- How do I check that my key and Account ID work?Send a tiny Flash request; a 200 means both headers are right. 401 codes tell you which part is wrong.How-to
- How do I choose an effort with cURL?Use a model id like supercosmos-heavy, or "model": "supercosmos" with "effort".How-to
- How do I debug a failing request with cURL?Use -v to see the full request and response headers, and print the error body; never share the output with your key in it.Troubleshooting
- How do I get just the answer text from cURL?Pipe the response through jq and print .choices[0].message.content and .usage.How-to
- How do I list models with cURL?GET /v1/models returns every id, its price, the family details and retired ids. No key needed.How-to
- How do I print only the text of a streamed reply with cURL?Pipe curl -N through sed and jq to extract delta.content from each data: line.How-to
- How do I run the cURL example in Windows Command Prompt?cmd.exe doesn't accept single quotes: put the body in a file and use -d @body.json, with ^ for line breaks.How-to
- How do I see rate limit and request id headers with cURL?Add -i to print response headers such as X-Request-Id, X-RateLimit-Limit and X-RateLimit-Remaining.How-to
- How do I send a long prompt with cURL without quoting problems?Write the JSON body to a file and send it with -d @body.json.How-to
- How do I stream with cURL?Add "stream": true and use curl -N so events print as they arrive.How-to
- How do I test tool calling with cURL?Send a tools array; the reply contains tool_calls with JSON arguments you then answer with a tool message.How-to
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.