Create chat response
curl --request POST \
--url https://api.caprioletech.com/v1/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai-latest",
"input": "Hello World!"
}
'import requests
url = "https://api.caprioletech.com/v1/chat"
payload = {
"model": "openai-latest",
"input": "Hello World!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'openai-latest', input: 'Hello World!'})
};
fetch('https://api.caprioletech.com/v1/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.caprioletech.com/v1/chat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'openai-latest',
'input' => 'Hello World!'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.caprioletech.com/v1/chat"
payload := strings.NewReader("{\n \"model\": \"openai-latest\",\n \"input\": \"Hello World!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.caprioletech.com/v1/chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"openai-latest\",\n \"input\": \"Hello World!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caprioletech.com/v1/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"openai-latest\",\n \"input\": \"Hello World!\"\n}"
response = http.request(request)
puts response.read_body{
"id": "49da8eb7-916b-43a3-ab02-442bc2841839",
"model": "openai/gpt-6-astra",
"result": {
"text": "Here is a short joke."
},
"usage": {
"input_tokens": 8,
"output_tokens": 6,
"total_tokens": 14,
"cached_tokens": 0,
"charged_tokens": 14
}
}Endpoints
Chat
Creates a text response from a model.
POST
/
v1
/
chat
Create chat response
curl --request POST \
--url https://api.caprioletech.com/v1/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai-latest",
"input": "Hello World!"
}
'import requests
url = "https://api.caprioletech.com/v1/chat"
payload = {
"model": "openai-latest",
"input": "Hello World!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'openai-latest', input: 'Hello World!'})
};
fetch('https://api.caprioletech.com/v1/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.caprioletech.com/v1/chat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'openai-latest',
'input' => 'Hello World!'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.caprioletech.com/v1/chat"
payload := strings.NewReader("{\n \"model\": \"openai-latest\",\n \"input\": \"Hello World!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.caprioletech.com/v1/chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"openai-latest\",\n \"input\": \"Hello World!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caprioletech.com/v1/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"openai-latest\",\n \"input\": \"Hello World!\"\n}"
response = http.request(request)
puts response.read_body{
"id": "49da8eb7-916b-43a3-ab02-442bc2841839",
"model": "openai/gpt-6-astra",
"result": {
"text": "Here is a short joke."
},
"usage": {
"input_tokens": 8,
"output_tokens": 6,
"total_tokens": 14,
"cached_tokens": 0,
"charged_tokens": 14
}
}Use this endpoint to send plain text input to a model and receive a plain text response. This Capriole-native route is non-streaming; use Chat Completions, Responses, or Messages when your client needs an SSE stream.
POST /v1/chat accepts openai-latest, claude-latest, google-latest, and public concrete model IDs returned by GET /v1/models. Use a latest alias to let Capriole AI choose our recommended flagship model for that provider. Use a concrete model ID when version pinning matters.
GPT-6 Astra has two Web Chat presets: Thinking (medium, selected by default) and Fast (low). GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, each with Thinking and Fast presets, and both GPT-5.6 presets are available under Other Models. The public API uses openai-latest, openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6-sol, or openai/gpt-6-luna, not the browser-only Thinking IDs. This native Chat endpoint uses Astra’s low preset; Responses and Chat Completions forward the caller’s reasoning options unchanged.
Capriole AI web chat and the public API are separate product surfaces. In web chat, Fable 5.1, Fable 5.1 Thinking, Opus 5.5, and Opus 5.5 Thinking are the primary Anthropic modes, while Fable 5, Fable 5 Thinking, Opus 5, and Opus 5 Thinking appear under Other Models. The public API does not expose web chat thinking presets as separate model IDs; for Claude Chat API requests, use claude-latest or a concrete public Claude model ID such as anthropic/claude-fable-5-1, anthropic/claude-fable-5, anthropic/claude-opus-5-5, anthropic/claude-opus-5, or anthropic/claude-sonnet-4-6. Existing Opus 4.8, Opus 4.7, and Opus 4.6 integrations remain supported.Authorizations
Use an API key created in the Capriole AI page. Send it as Authorization: Bearer sk-....
Body
application/json
Public model identifier or latest alias returned by GET /v1/models
Available options:
openai-latest, openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6-sol, openai/gpt-6-luna, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5, claude-latest, anthropic/claude-fable-5-1, anthropic/claude-opus-5-5, anthropic/claude-fable-5, anthropic/claude-opus-5, anthropic/claude-opus-4-8, anthropic/claude-opus-4-7, anthropic/claude-opus-4-6, anthropic/claude-sonnet-4-6, google-latest, google/gemini-3.1-pro-preview, google/gemini-3.8-flash, xai/grok-4.7, xai/grok-4.6, xai/grok-4.5, zai/glm-5.3-flash, zai/glm-5.2, moonshot/kimi-k3 Plain text user input
Enable provider-native web search when the selected model supports it.
Optional sampling temperature.
Required range:
x >= 0Optional maximum number of output tokens.
Optional maximum number of provider retries.
Required range:
x >= 0Optional provider request timeout in seconds.
Last modified on September 30, 2026