Read a thread back
What a thread of yours says, in order. Another account's thread answers 404 conversation_not_found, the answer a thread that never existed gets. Rewound messages are not the thread's any more and are left out, as the model is never sent them. Messages older than the retention window have been scrubbed and are left out like rewound ones, so a scrubbed thread reads back empty; a turn that continues one answers history_scrubbed: true. No message prints a charge: an answer carries its job_id, and GET /jobs/{id} answers what the turn cost from the ledger. It needs chat:read; neither text:write nor the older chat:write reads a thread back.
curl https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages \
-H "Authorization: Bearer $AURAY_API_KEY"import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const page = await auray.platform.chat.messages("0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f");
console.dir(page, { depth: null });from auray_client import Client
auray = Client() # reads AURAY_API_KEY
page = auray.platform.chat.messages("0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f")
print(page){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "read_chat",
"arguments": {
"conversation_id": "0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f"
}
}
}const res = await fetch("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.AURAY_API_KEY}` },
});
console.log(await res.json());import os, requests
r = requests.get(
"https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
)
r.raise_for_status()
print(r.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
uri = URI("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"conversation_id": "<string>",
"data": [
{
"id": "<string>",
"object": "<string>",
"seq": 123,
"role": "<string>",
"status": "<string>",
"content": "<string>",
"reasoning": "<string>",
"model": "<string>",
"finish_reason": "<string>",
"error_code": "<string>",
"job_id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"has_more": true,
"next_after": 123
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}Authorizations
Bearer auray_sk_… — chat:read — not jobs:read, and not text:write or the older chat:write, which submit turns and start threads but do not read one back.
Path Parameters
Query Parameters
invalid_limit. 1 to 200.next_after from the previous page; the next page starts strictly after that seq. 0 to …."true".OK
"list".Show child attributes
"chat.message".after pages by it."user", "assistant".complete for a message the thread holds; pending or streaming while an answer is being written; stopped for an answer stopped before it finished, failed for one that broke or never began (error_code says why). A stopped or failed answer keeps what was delivered before it ended, and the next turn is sent it, marked as cut off, with its end kept so the model can continue it. It is charged as delivered — except on a chat model another company runs, where an answer you stopped once we had sent it to the model, or one of our time limits cut off, is charged in full, for its prompt and the longest answer it allowed, never more than its reserve (the chat settlement table, https://auray.ai/docs/jobs#chat-settlement). One of "pending", "streaming", "complete", "stopped", "failed".include_reasoning=true. May be null.GET /jobs/{id} reads — what it cost from the ledger included. Null on your own messages. May be null.seq of the last message on this one. May be null.Headers:
| Header | Description |
|---|---|
RateLimit-Limit | Burst capacity. |
RateLimit-Remaining | |
RateLimit-Reset | Seconds until refill. |
X-RateLimit-Limit | |
X-RateLimit-Remaining | |
X-RateLimit-Reset | Unix seconds. The X- spelling is what client libraries read. |
X-Request-Id |
Was this page helpful?
curl https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages \
-H "Authorization: Bearer $AURAY_API_KEY"import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const page = await auray.platform.chat.messages("0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f");
console.dir(page, { depth: null });from auray_client import Client
auray = Client() # reads AURAY_API_KEY
page = auray.platform.chat.messages("0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f")
print(page){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "read_chat",
"arguments": {
"conversation_id": "0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f"
}
}
}const res = await fetch("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.AURAY_API_KEY}` },
});
console.log(await res.json());import os, requests
r = requests.get(
"https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
)
r.raise_for_status()
print(r.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
uri = URI("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.auray.ai/v1/chat/conversations/0d6f1a52-3c1e-4b8a-9f3e-2a1b0c9d8e7f/messages");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"conversation_id": "<string>",
"data": [
{
"id": "<string>",
"object": "<string>",
"seq": 123,
"role": "<string>",
"status": "<string>",
"content": "<string>",
"reasoning": "<string>",
"model": "<string>",
"finish_reason": "<string>",
"error_code": "<string>",
"job_id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"has_more": true,
"next_after": 123
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}