curl --request POST \
--url https://api-dev.narrative.io/model-inference/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data_plane_id": "fef9904e-d263-4930-85f7-1e28cce40f89",
"model": "anthropic.claude-sonnet-4.5",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "Only generate geographical coordinates in the northern hemisphere"
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Generate a geographical coordinate"
}
]
}
],
"inference_config": {
"output_format_schema": {
"title": "Longitude and Latitude Values",
"description": "A geographical coordinate.",
"required": [
"latitude",
"longitude"
],
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
},
"additionalProperties": false
},
"max_tokens": 1024,
"temperature": 0.3
},
"tags": [
"test"
]
}
'import requests
url = "https://api-dev.narrative.io/model-inference/run"
payload = {
"data_plane_id": "fef9904e-d263-4930-85f7-1e28cce40f89",
"model": "anthropic.claude-sonnet-4.5",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "Only generate geographical coordinates in the northern hemisphere"
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Generate a geographical coordinate"
}
]
}
],
"inference_config": {
"output_format_schema": {
"title": "Longitude and Latitude Values",
"description": "A geographical coordinate.",
"required": ["latitude", "longitude"],
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
},
"additionalProperties": False
},
"max_tokens": 1024,
"temperature": 0.3
},
"tags": ["test"]
}
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({
data_plane_id: 'fef9904e-d263-4930-85f7-1e28cce40f89',
model: 'anthropic.claude-sonnet-4.5',
messages: [
{
role: 'system',
content: [
{
type: 'text',
text: 'Only generate geographical coordinates in the northern hemisphere'
}
]
},
{
role: 'user',
content: [{type: 'text', text: 'Generate a geographical coordinate'}]
}
],
inference_config: {
output_format_schema: {
title: 'Longitude and Latitude Values',
description: 'A geographical coordinate.',
required: ['latitude', 'longitude'],
type: 'object',
properties: {
latitude: {type: 'number', minimum: -90, maximum: 90},
longitude: {type: 'number', minimum: -180, maximum: 180}
},
additionalProperties: false
},
max_tokens: 1024,
temperature: 0.3
},
tags: ['test']
})
};
fetch('https://api-dev.narrative.io/model-inference/run', 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-dev.narrative.io/model-inference/run",
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([
'data_plane_id' => 'fef9904e-d263-4930-85f7-1e28cce40f89',
'model' => 'anthropic.claude-sonnet-4.5',
'messages' => [
[
'role' => 'system',
'content' => [
[
'type' => 'text',
'text' => 'Only generate geographical coordinates in the northern hemisphere'
]
]
],
[
'role' => 'user',
'content' => [
[
'type' => 'text',
'text' => 'Generate a geographical coordinate'
]
]
]
],
'inference_config' => [
'output_format_schema' => [
'title' => 'Longitude and Latitude Values',
'description' => 'A geographical coordinate.',
'required' => [
'latitude',
'longitude'
],
'type' => 'object',
'properties' => [
'latitude' => [
'type' => 'number',
'minimum' => -90,
'maximum' => 90
],
'longitude' => [
'type' => 'number',
'minimum' => -180,
'maximum' => 180
]
],
'additionalProperties' => false
],
'max_tokens' => 1024,
'temperature' => 0.3
],
'tags' => [
'test'
]
]),
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-dev.narrative.io/model-inference/run"
payload := strings.NewReader("{\n \"data_plane_id\": \"fef9904e-d263-4930-85f7-1e28cce40f89\",\n \"model\": \"anthropic.claude-sonnet-4.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Only generate geographical coordinates in the northern hemisphere\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Generate a geographical coordinate\"\n }\n ]\n }\n ],\n \"inference_config\": {\n \"output_format_schema\": {\n \"title\": \"Longitude and Latitude Values\",\n \"description\": \"A geographical coordinate.\",\n \"required\": [\n \"latitude\",\n \"longitude\"\n ],\n \"type\": \"object\",\n \"properties\": {\n \"latitude\": {\n \"type\": \"number\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n \"longitude\": {\n \"type\": \"number\",\n \"minimum\": -180,\n \"maximum\": 180\n }\n },\n \"additionalProperties\": false\n },\n \"max_tokens\": 1024,\n \"temperature\": 0.3\n },\n \"tags\": [\n \"test\"\n ]\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-dev.narrative.io/model-inference/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data_plane_id\": \"fef9904e-d263-4930-85f7-1e28cce40f89\",\n \"model\": \"anthropic.claude-sonnet-4.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Only generate geographical coordinates in the northern hemisphere\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Generate a geographical coordinate\"\n }\n ]\n }\n ],\n \"inference_config\": {\n \"output_format_schema\": {\n \"title\": \"Longitude and Latitude Values\",\n \"description\": \"A geographical coordinate.\",\n \"required\": [\n \"latitude\",\n \"longitude\"\n ],\n \"type\": \"object\",\n \"properties\": {\n \"latitude\": {\n \"type\": \"number\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n \"longitude\": {\n \"type\": \"number\",\n \"minimum\": -180,\n \"maximum\": 180\n }\n },\n \"additionalProperties\": false\n },\n \"max_tokens\": 1024,\n \"temperature\": 0.3\n },\n \"tags\": [\n \"test\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/model-inference/run")
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 \"data_plane_id\": \"fef9904e-d263-4930-85f7-1e28cce40f89\",\n \"model\": \"anthropic.claude-sonnet-4.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Only generate geographical coordinates in the northern hemisphere\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Generate a geographical coordinate\"\n }\n ]\n }\n ],\n \"inference_config\": {\n \"output_format_schema\": {\n \"title\": \"Longitude and Latitude Values\",\n \"description\": \"A geographical coordinate.\",\n \"required\": [\n \"latitude\",\n \"longitude\"\n ],\n \"type\": \"object\",\n \"properties\": {\n \"latitude\": {\n \"type\": \"number\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n \"longitude\": {\n \"type\": \"number\",\n \"minimum\": -180,\n \"maximum\": 180\n }\n },\n \"additionalProperties\": false\n },\n \"max_tokens\": 1024,\n \"temperature\": 0.3\n },\n \"tags\": [\n \"test\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Run model inference
Create a job to perform an LLM call. Supported on both AWS and Snowflake data planes.
curl --request POST \
--url https://api-dev.narrative.io/model-inference/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data_plane_id": "fef9904e-d263-4930-85f7-1e28cce40f89",
"model": "anthropic.claude-sonnet-4.5",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "Only generate geographical coordinates in the northern hemisphere"
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Generate a geographical coordinate"
}
]
}
],
"inference_config": {
"output_format_schema": {
"title": "Longitude and Latitude Values",
"description": "A geographical coordinate.",
"required": [
"latitude",
"longitude"
],
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
},
"additionalProperties": false
},
"max_tokens": 1024,
"temperature": 0.3
},
"tags": [
"test"
]
}
'import requests
url = "https://api-dev.narrative.io/model-inference/run"
payload = {
"data_plane_id": "fef9904e-d263-4930-85f7-1e28cce40f89",
"model": "anthropic.claude-sonnet-4.5",
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "Only generate geographical coordinates in the northern hemisphere"
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Generate a geographical coordinate"
}
]
}
],
"inference_config": {
"output_format_schema": {
"title": "Longitude and Latitude Values",
"description": "A geographical coordinate.",
"required": ["latitude", "longitude"],
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
}
},
"additionalProperties": False
},
"max_tokens": 1024,
"temperature": 0.3
},
"tags": ["test"]
}
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({
data_plane_id: 'fef9904e-d263-4930-85f7-1e28cce40f89',
model: 'anthropic.claude-sonnet-4.5',
messages: [
{
role: 'system',
content: [
{
type: 'text',
text: 'Only generate geographical coordinates in the northern hemisphere'
}
]
},
{
role: 'user',
content: [{type: 'text', text: 'Generate a geographical coordinate'}]
}
],
inference_config: {
output_format_schema: {
title: 'Longitude and Latitude Values',
description: 'A geographical coordinate.',
required: ['latitude', 'longitude'],
type: 'object',
properties: {
latitude: {type: 'number', minimum: -90, maximum: 90},
longitude: {type: 'number', minimum: -180, maximum: 180}
},
additionalProperties: false
},
max_tokens: 1024,
temperature: 0.3
},
tags: ['test']
})
};
fetch('https://api-dev.narrative.io/model-inference/run', 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-dev.narrative.io/model-inference/run",
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([
'data_plane_id' => 'fef9904e-d263-4930-85f7-1e28cce40f89',
'model' => 'anthropic.claude-sonnet-4.5',
'messages' => [
[
'role' => 'system',
'content' => [
[
'type' => 'text',
'text' => 'Only generate geographical coordinates in the northern hemisphere'
]
]
],
[
'role' => 'user',
'content' => [
[
'type' => 'text',
'text' => 'Generate a geographical coordinate'
]
]
]
],
'inference_config' => [
'output_format_schema' => [
'title' => 'Longitude and Latitude Values',
'description' => 'A geographical coordinate.',
'required' => [
'latitude',
'longitude'
],
'type' => 'object',
'properties' => [
'latitude' => [
'type' => 'number',
'minimum' => -90,
'maximum' => 90
],
'longitude' => [
'type' => 'number',
'minimum' => -180,
'maximum' => 180
]
],
'additionalProperties' => false
],
'max_tokens' => 1024,
'temperature' => 0.3
],
'tags' => [
'test'
]
]),
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-dev.narrative.io/model-inference/run"
payload := strings.NewReader("{\n \"data_plane_id\": \"fef9904e-d263-4930-85f7-1e28cce40f89\",\n \"model\": \"anthropic.claude-sonnet-4.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Only generate geographical coordinates in the northern hemisphere\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Generate a geographical coordinate\"\n }\n ]\n }\n ],\n \"inference_config\": {\n \"output_format_schema\": {\n \"title\": \"Longitude and Latitude Values\",\n \"description\": \"A geographical coordinate.\",\n \"required\": [\n \"latitude\",\n \"longitude\"\n ],\n \"type\": \"object\",\n \"properties\": {\n \"latitude\": {\n \"type\": \"number\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n \"longitude\": {\n \"type\": \"number\",\n \"minimum\": -180,\n \"maximum\": 180\n }\n },\n \"additionalProperties\": false\n },\n \"max_tokens\": 1024,\n \"temperature\": 0.3\n },\n \"tags\": [\n \"test\"\n ]\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-dev.narrative.io/model-inference/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data_plane_id\": \"fef9904e-d263-4930-85f7-1e28cce40f89\",\n \"model\": \"anthropic.claude-sonnet-4.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Only generate geographical coordinates in the northern hemisphere\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Generate a geographical coordinate\"\n }\n ]\n }\n ],\n \"inference_config\": {\n \"output_format_schema\": {\n \"title\": \"Longitude and Latitude Values\",\n \"description\": \"A geographical coordinate.\",\n \"required\": [\n \"latitude\",\n \"longitude\"\n ],\n \"type\": \"object\",\n \"properties\": {\n \"latitude\": {\n \"type\": \"number\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n \"longitude\": {\n \"type\": \"number\",\n \"minimum\": -180,\n \"maximum\": 180\n }\n },\n \"additionalProperties\": false\n },\n \"max_tokens\": 1024,\n \"temperature\": 0.3\n },\n \"tags\": [\n \"test\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/model-inference/run")
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 \"data_plane_id\": \"fef9904e-d263-4930-85f7-1e28cce40f89\",\n \"model\": \"anthropic.claude-sonnet-4.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Only generate geographical coordinates in the northern hemisphere\"\n }\n ]\n },\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Generate a geographical coordinate\"\n }\n ]\n }\n ],\n \"inference_config\": {\n \"output_format_schema\": {\n \"title\": \"Longitude and Latitude Values\",\n \"description\": \"A geographical coordinate.\",\n \"required\": [\n \"latitude\",\n \"longitude\"\n ],\n \"type\": \"object\",\n \"properties\": {\n \"latitude\": {\n \"type\": \"number\",\n \"minimum\": -90,\n \"maximum\": 90\n },\n \"longitude\": {\n \"type\": \"number\",\n \"minimum\": -180,\n \"maximum\": 180\n }\n },\n \"additionalProperties\": false\n },\n \"max_tokens\": 1024,\n \"temperature\": 0.3\n },\n \"tags\": [\n \"test\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Data plane identifier, must be provided when registering dataset in external dataplane.
anthropic.claude-haiku-4.5, anthropic.claude-sonnet-4.5, anthropic.claude-sonnet-4.6, anthropic.claude-sonnet-5.0, anthropic.claude-opus-4.5, anthropic.claude-opus-4.6, anthropic.claude-opus-4.7, anthropic.claude-opus-4.8, anthropic.claude-opus-5.0, openai.gpt-oss-120b, openai.gpt-4.1, openai.o4-mini Ordered conversation turns. The current wire shape carries a content array of
content blocks (text / tool_use / tool_result) so multi-turn flows with tool
interactions can round-trip without flattening to prose.
The legacy {role, text: String} shape is still accepted on the request side for
backwards compatibility — the API auto-canonicalizes legacy messages into a single
text content block. New integrations should use the content-block shape;
responses always emit it.
- Message (content-block shape, recommended)
- Message (legacy `{role, text}` shape, still accepted)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
OK
The id of the job that has been enqueued.
Was this page helpful?

