curl --request POST \
--url https://api.fiveninelabs.com/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"max_spend_usd": 123,
"query_budget_ms": 123,
"concurrency": 4,
"webhook_url": "<string>",
"metadata": {}
}
'import requests
url = "https://api.fiveninelabs.com/v1/sessions"
payload = {
"query": "<string>",
"max_spend_usd": 123,
"query_budget_ms": 123,
"concurrency": 4,
"webhook_url": "<string>",
"metadata": {}
}
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({
query: '<string>',
max_spend_usd: 123,
query_budget_ms: 123,
concurrency: 4,
webhook_url: '<string>',
metadata: {}
})
};
fetch('https://api.fiveninelabs.com/v1/sessions', 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.fiveninelabs.com/v1/sessions",
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([
'query' => '<string>',
'max_spend_usd' => 123,
'query_budget_ms' => 123,
'concurrency' => 4,
'webhook_url' => '<string>',
'metadata' => [
]
]),
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.fiveninelabs.com/v1/sessions"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"max_spend_usd\": 123,\n \"query_budget_ms\": 123,\n \"concurrency\": 4,\n \"webhook_url\": \"<string>\",\n \"metadata\": {}\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.fiveninelabs.com/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"max_spend_usd\": 123,\n \"query_budget_ms\": 123,\n \"concurrency\": 4,\n \"webhook_url\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fiveninelabs.com/v1/sessions")
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 \"query\": \"<string>\",\n \"max_spend_usd\": 123,\n \"query_budget_ms\": 123,\n \"concurrency\": 4,\n \"webhook_url\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"id": "sess_9m2kd",
"object": "session",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"query": "<string>",
"turn": 123,
"spend_usd": 123,
"reserved_usd": 123,
"max_spend_usd": 123,
"sources": 123,
"records": 123,
"receipts_signed": 123,
"unchecked": 123,
"key_id": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"metadata": {},
"links": {
"stream": "<string>",
"events": "<string>",
"result": "<string>",
"rows": "<string>",
"receipts": "<string>",
"console": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Start a session (the first turn)
With Accept: text/event-stream, streams the run on this request. Otherwise returns 201 immediately; watch via stream, events, result long-poll, or webhooks. Spending POST — honors Idempotency-Key.
curl --request POST \
--url https://api.fiveninelabs.com/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"max_spend_usd": 123,
"query_budget_ms": 123,
"concurrency": 4,
"webhook_url": "<string>",
"metadata": {}
}
'import requests
url = "https://api.fiveninelabs.com/v1/sessions"
payload = {
"query": "<string>",
"max_spend_usd": 123,
"query_budget_ms": 123,
"concurrency": 4,
"webhook_url": "<string>",
"metadata": {}
}
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({
query: '<string>',
max_spend_usd: 123,
query_budget_ms: 123,
concurrency: 4,
webhook_url: '<string>',
metadata: {}
})
};
fetch('https://api.fiveninelabs.com/v1/sessions', 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.fiveninelabs.com/v1/sessions",
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([
'query' => '<string>',
'max_spend_usd' => 123,
'query_budget_ms' => 123,
'concurrency' => 4,
'webhook_url' => '<string>',
'metadata' => [
]
]),
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.fiveninelabs.com/v1/sessions"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"max_spend_usd\": 123,\n \"query_budget_ms\": 123,\n \"concurrency\": 4,\n \"webhook_url\": \"<string>\",\n \"metadata\": {}\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.fiveninelabs.com/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"max_spend_usd\": 123,\n \"query_budget_ms\": 123,\n \"concurrency\": 4,\n \"webhook_url\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fiveninelabs.com/v1/sessions")
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 \"query\": \"<string>\",\n \"max_spend_usd\": 123,\n \"query_budget_ms\": 123,\n \"concurrency\": 4,\n \"webhook_url\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"id": "sess_9m2kd",
"object": "session",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"query": "<string>",
"turn": 123,
"spend_usd": 123,
"reserved_usd": 123,
"max_spend_usd": 123,
"sources": 123,
"records": 123,
"receipts_signed": 123,
"unchecked": 123,
"key_id": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"metadata": {},
"links": {
"stream": "<string>",
"events": "<string>",
"result": "<string>",
"rows": "<string>",
"receipts": "<string>",
"console": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Authorizations
fn_live_… or fn_test_… — Authorization: Bearer
Headers
Dated API version; defaults to the account pin. Honesty note: with one version in existence the gateway echoes any value back as effective WITHOUT validating it — validation against the known-versions set is planned, so send only real dated versions from https://docs.fiveninelabs.com/changelog
"2026-08-26"
24h replay window; a retry never bills twice
255Body
the natural-language question
this run's reservation and ceiling (per-run, not lifetime); key caps apply
whole-query deadline; bounded by the engine's 90-minute backstop
x <= 54000001 <= x <= 8Show child attributes
Show child attributes
Response
SSE stream (when Accept is text/event-stream)