Start here
Start a thread
POST
/v1/chat/conversationson https://api.auray.ai/v1Optional — POST /chat mints one when no conversation_id is given.
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.
#Authentication
Authorization: Bearer auray_sk_… — text:write, or the older chat:write.
#Request
#Headers
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | no | Your own name for this thread. A resend with the same key answers the thread the first send made rather than a second one. |
#Body
application/json.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | no | "glm-5-3-flash" | The first three 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. One of "glm-5-3-flash", "deepseek-v4-1-flash", "kimi-k3", "qwen", "kimi". |
title | string | no | — | 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_key | string | no | — | 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. |
#Example request
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()}");#Responses
#200 OK
The thread an earlier send with the same idempotency key made.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | no | — | |
object | string | no | — | One of "conversation". |
model | string | no | — | |
title | string | no | — | |
created_at | string | no | — | |
replayed | boolean | no | — | 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 |
#201 Created
Created.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | no | — | |
object | string | no | — | One of "conversation". |
model | string | no | — | |
title | string | no | — | |
created_at | string | no | — | |
replayed | boolean | no | — | 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 |
#400 Bad Request
#401 Unauthorized
#403 Forbidden
#413 Payload Too Large
#429 Too Many Requests
#500 Internal Server Error
#503 Service Unavailable
#Status codes
| Status | Meaning |
|---|---|
200 | The thread an earlier send with the same idempotency key made. |
201 | Created. |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
413 | Payload Too Large |
429 | Too Many Requests |
500 | Internal Server Error |
503 | Service Unavailable |
Every refusal names its code, and every code is explained at Errors.