Ask AI SRE a follow-up
const url = 'https://app.tunnelhq.com/api/v1/ai-sre/conversations/54/messages';const options = { method: 'POST', headers: { 'X-Project-Id': 'prj_12', 'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json' }, body: '{"question":"Was it slow before that?"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.tunnelhq.com/api/v1/ai-sre/conversations/54/messages \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --header 'X-Project-Id: prj_12' \ --data '{ "question": "Was it slow before that?" }'Asks a follow-up question in a conversation, and answers at once. Read the answer as for a new question. A conversation has one answer being written at a time.
The answer counts toward the project’s monthly limit, and it needs a role that can mute and pause monitors (Owner, Admin, and Manager by default).
Need an API key? See Getting an API key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The conversation’s id, a number such as 54, from Ask AI SRE or List AI SRE conversations.
Example
54Header Parameters
Section titled “Header Parameters”The project, as prj_12 or 12. A workspace key can only reach its own workspace’s projects.
Example
prj_12Request Bodyrequired
Section titled “Request Bodyrequired”object
The question, in plain words. A pasted list of servers fits whole.
Files for this question, from Add a file to an AI SRE question, as att_91. Your own files, not yet sent. Up to 5, and 40 PDF pages across them.
Example
{ "question": "Was it slow before that?"}Responses
Section titled “ Responses ”The follow-up is asked, and its answer is being written.
object
The conversation.
The conversation’s page in the dashboard.
Example
{ "id": 54, "running": true, "url": "https://app.tunnelhq.com/ai-sre/c/54"}Headers
Section titled “Headers”Requests the workspace’s plan allows per minute.
Requests left in the current minute.
Unix time, in seconds, when the current minute ends.
The question is empty or too long, the monitor isn’t in the project, or the X-Project-Id header is missing or malformed.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 400, "message": "Write a question first."}{ "error": true, "code": 400, "message": "A question can be up to 20,000 characters. Add a longer list as a file."}{ "error": true, "code": 400, "message": "monitor_id must be a tunnel or check id, such as srv_81."}{ "error": true, "code": 400, "message": "That monitor isn't in this project."}The API key is missing, wrong, expired, switched off, or no longer valid.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 401, "message": "API key is required. Provide X-API-Key header or Authorization: Bearer <key>"}{ "error": true, "code": 401, "message": "Invalid or expired API key"}{ "error": true, "code": 401, "message": "API key has expired"}{ "error": true, "code": 401, "message": "API key owner account is inactive"}{ "error": true, "code": 401, "message": "This API key's workspace access has been removed"}The role can’t mute and pause monitors, which asking AI SRE needs, or the key can’t reach this project.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 403, "message": "Asking AI SRE needs a role that can mute and pause monitors."}{ "error": true, "code": 403, "message": "You do not have access to this project"}The project has no such conversation.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Example
{ "error": true, "code": 404, "message": "No such conversation in this project."}An answer is still being written in this conversation.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Example
{ "error": true, "code": 409, "message": "AI SRE is still answering. Wait for it to finish."}The project has used its answers for the month, already has 3 answers being written, or a usage limit was reached (see the other operations’ 429).
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 429, "message": "This project has used all its AI SRE answers for this month. An owner can raise the limit in AI SRE settings."}{ "error": true, "code": 429, "message": "AI SRE is already answering 3 questions for this project. Ask again when one is done."}Something failed on TunnelHQ’s side.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Example
{ "error": true, "code": 500, "message": "Internal server error"}This TunnelHQ server can’t run AI SRE now.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 503, "message": "AI SRE is switched off on this server."}{ "error": true, "code": 503, "message": "AI SRE has no API key on this server."}