curl -X POST "https://api.deeptrace.com/api/v1/chat" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_api_key>" \
-d '{
"messages": [
{"role": "user", "content": "What errors are happening in production right now?"}
]
}'
import requests
response = requests.post(
"https://api.deeptrace.com/api/v1/chat",
headers={"Authorization": "Bearer <your_api_key>"},
json={
"messages": [
{"role": "user", "content": "What errors are happening in production right now?"}
]
}
)
data = response.json()
print(data["chat_id"], data["response"])
const response = await fetch(
"https://api.deeptrace.com/api/v1/chat",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <your_api_key>",
},
body: JSON.stringify({
messages: [
{ role: "user", content: "What errors are happening in production right now?" },
],
}),
}
);
const data = await response.json();
console.log(data.chat_id, data.response);
{
"chat_id": "baa1b1be-4905-4448-9a37-159f08dfc570",
"response": "Let me check your error tracking tools...",
"usage": {
"input_tokens": 3,
"output_tokens": 624,
"cache_creation_input_tokens": 92161,
"cache_read_input_tokens": 0,
"cost": 0.59,
"model": "claude-opus-4-6",
"api_calls_count": 1
}
}
API
Send Chat Message
Send a message and receive an AI-powered response
POST
/
api
/
v1
/
chat
curl -X POST "https://api.deeptrace.com/api/v1/chat" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_api_key>" \
-d '{
"messages": [
{"role": "user", "content": "What errors are happening in production right now?"}
]
}'
import requests
response = requests.post(
"https://api.deeptrace.com/api/v1/chat",
headers={"Authorization": "Bearer <your_api_key>"},
json={
"messages": [
{"role": "user", "content": "What errors are happening in production right now?"}
]
}
)
data = response.json()
print(data["chat_id"], data["response"])
const response = await fetch(
"https://api.deeptrace.com/api/v1/chat",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <your_api_key>",
},
body: JSON.stringify({
messages: [
{ role: "user", content: "What errors are happening in production right now?" },
],
}),
}
);
const data = await response.json();
console.log(data.chat_id, data.response);
{
"chat_id": "baa1b1be-4905-4448-9a37-159f08dfc570",
"response": "Let me check your error tracking tools...",
"usage": {
"input_tokens": 3,
"output_tokens": 624,
"cache_creation_input_tokens": 92161,
"cache_read_input_tokens": 0,
"cost": 0.59,
"model": "claude-opus-4-6",
"api_calls_count": 1
}
}
Send a message and receive an AI-powered response. Supports multi-turn conversations by passing a
Stream event types:
chat_id from a previous response.
Headers
string
required
Bearer token with your Deeptrace API key. Format:
Bearer <your_api_key>.Query Parameters
boolean
default:"false"
Enable Server-Sent Events streaming.
Body
object[]
required
string
ID of an existing chat to continue a conversation.
string
default:"claude-opus-4-6"
Model to use for the response.
string
Custom system prompt override.
curl -X POST "https://api.deeptrace.com/api/v1/chat" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_api_key>" \
-d '{
"messages": [
{"role": "user", "content": "What errors are happening in production right now?"}
]
}'
import requests
response = requests.post(
"https://api.deeptrace.com/api/v1/chat",
headers={"Authorization": "Bearer <your_api_key>"},
json={
"messages": [
{"role": "user", "content": "What errors are happening in production right now?"}
]
}
)
data = response.json()
print(data["chat_id"], data["response"])
const response = await fetch(
"https://api.deeptrace.com/api/v1/chat",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <your_api_key>",
},
body: JSON.stringify({
messages: [
{ role: "user", content: "What errors are happening in production right now?" },
],
}),
}
);
const data = await response.json();
console.log(data.chat_id, data.response);
Returns
Returns the chat ID and the assistant’s response along with usage information.{
"chat_id": "baa1b1be-4905-4448-9a37-159f08dfc570",
"response": "Let me check your error tracking tools...",
"usage": {
"input_tokens": 3,
"output_tokens": 624,
"cache_creation_input_tokens": 92161,
"cache_read_input_tokens": 0,
"cost": 0.59,
"model": "claude-opus-4-6",
"api_calls_count": 1
}
}
string
required
UUID of the chat. Use this to continue the conversation or retrieve the chat later.
string
required
The assistant’s response text.
object
required
Token usage and cost information for the request.
Continuing a Conversation
Pass thechat_id from a previous response to continue the conversation:
curl -X POST "https://api.deeptrace.com/api/v1/chat" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_api_key>" \
-d '{
"chat_id": "baa1b1be-4905-4448-9a37-159f08dfc570",
"messages": [
{"role": "user", "content": "Can you dig deeper into the top error?"}
]
}'
Streaming
Add?stream=true to receive Server-Sent Events:
curl -X POST "https://api.deeptrace.com/api/v1/chat?stream=true" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_api_key>" \
-d '{
"messages": [
{"role": "user", "content": "What errors are happening in production?"}
]
}'
| Event Type | Description |
|---|---|
start | Stream initiated, includes messageId and chatId |
reasoning-start | Beginning of reasoning block |
reasoning-delta | Incremental reasoning text |
reasoning-end | End of reasoning block |
text-start | Beginning of response text |
text-delta | Incremental response text |
text-end | End of response text |