Chat
Start a thread
Optional — POST /chat mints one when no conversation_id is given. With Idempotency-Key (or idempotency_key in the body, which wins when both are sent) the create is one thread however often it is sent: the first send answers 201, every resend answers 200 with replayed: true and the thread the first send made — its model and title, whatever the resend named.
POST
/v1/chat/conversations
curl -X POST https://api.auray.ai/v1/chat/conversations \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{}'import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const thread = await auray.platform.chat.conversation();
console.log(thread);from auray_client import Client
auray = Client() # reads AURAY_API_KEY
thread = auray.platform.chat.conversation()
print(thread)const res = await fetch("https://api.auray.ai/v1/chat/conversations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/chat/conversations",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/chat/conversations", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(new \stdClass(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/chat/conversations")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {}.to_json
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 {
String body = """
{}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/chat/conversations"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/chat/conversations");
var body = """
{}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"title": "<string>",
"created_at": "<string>",
"replayed": true
}{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"title": "<string>",
"created_at": "<string>",
"replayed": true
}{
"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
Authorizationstringheaderrequired
Bearer auray_sk_… — text:write, or the older chat:write.
Headers
Idempotency-Keystring
Your own name for this thread. A resend with the same key answers the thread the first send made rather than a second one.
modelstringdefault: "glm-5-3-flash"
The first five are the slots, and the default is the first of them.
qwen and kimi are the names two of these slots carried until 2026-09-14; they are still accepted and map to glm-5-3-flash and deepseek-v4-1-flash, and will be withdrawn once integrations have moved. A catalogue language model whose GET /models row carries chat answers here too, named by its address (auray-serverless/model/…, its catalogue slug also accepted) — no row carries it until such models are in force at the chat doors. One of "glm-5-3-flash", "deepseek-v4-1-flash", "kimi-k3", "qwen3-8", "glm-5-3", "qwen", "kimi", "auray-serverless/model/openai-gpt-5-nano" and 18 more
"auray-serverless/model/openai-gpt-5-mini", "auray-serverless/model/openai-gpt-5-4-nano", "auray-serverless/model/openai-gpt-5-4-mini", "auray-serverless/model/openai-gpt-5-4", "auray-serverless/model/openai-gpt-5-5", "auray-serverless/model/anthropic-claude-haiku-4-5", "auray-serverless/model/anthropic-claude-sonnet-4-6", "auray-serverless/model/anthropic-claude-opus-4-7", "auray-serverless/model/anthropic-claude-opus-4-8", "auray-serverless/model/anthropic-claude-fable-5", "auray-serverless/model/google-gemma-4-31b", "auray-serverless/model/google-gemini-3-1-flash-lite", "auray-serverless/model/google-gemini-3-flash", "auray-serverless/model/google-gemini-3-5-flash", "auray-serverless/model/google-gemini-3-1-pro", "auray-serverless/model/xai-grok-4-3", "auray-serverless/model/minimax-m3", "auray-serverless/model/zai-glm-5-1"titlestring
Truncated to 200 characters rather than refused, and the shortened string is what comes back.
maxLength is deliberately not declared: a validator built from it would reject a title this API accepts.idempotency_keystring
The same as the
Idempotency-Key header, and wins when both are sent. Either one outside the pattern is folded into a key inside it (its SHA-256) rather than refused, because this route read neither until it began keeping one thread per key: the same key is still the same thread.The thread an earlier send with the same idempotency key made.
idstring
objectstring
One of
"conversation".modelstring
titlestring
created_atstring
replayedboolean
true when an idempotency key named a thread an earlier send made, which is answered 200 rather than 201.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 |
Created.
idstring
objectstring
One of
"conversation".modelstring
titlestring
created_atstring
replayedboolean
true when an idempotency key named a thread an earlier send made, which is answered 200 rather than 201.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 -X POST https://api.auray.ai/v1/chat/conversations \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{}'import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const thread = await auray.platform.chat.conversation();
console.log(thread);from auray_client import Client
auray = Client() # reads AURAY_API_KEY
thread = auray.platform.chat.conversation()
print(thread)const res = await fetch("https://api.auray.ai/v1/chat/conversations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/chat/conversations",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/chat/conversations", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(new \stdClass(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/chat/conversations")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {}.to_json
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 {
String body = """
{}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/chat/conversations"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/chat/conversations");
var body = """
{}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"title": "<string>",
"created_at": "<string>",
"replayed": true
}{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"title": "<string>",
"created_at": "<string>",
"replayed": true
}{
"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>"
}