Skip to main content

curl / REST

Use Autrace with any HTTP client — curl, Postman, fetch, axios.

Basic request

curl https://gateway.autraceai.com/v1/chat/completions \
-H "Authorization: Bearer aut_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.5",
"messages": [{"role": "user", "content": "Hello!"}]
}'

Streaming

curl https://gateway.autraceai.com/v1/chat/completions \
-H "Authorization: Bearer aut_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-5.5","messages":[{"role":"user","content":"Count to 5"}],"stream":true}'

JavaScript fetch

const response = await fetch('https://gateway.autraceai.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer aut_live_YOUR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'openai/gpt-5.5',
messages: [{ role: 'user', content: 'Hello!' }],
}),
});
const data = await response.json();
console.log(data.choices[0].message.content);