Skip to main content
POST
/
model-inference
/
run
Run model inference
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"
  ]
}
'
{
  "job_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
data_plane_id
string<uuid>
required

Data plane identifier, must be provided when registering dataset in external dataplane.

model
enum<string>
required
Available options:
anthropic.claude-haiku-4.5,
anthropic.claude-sonnet-4.5,
anthropic.claude-opus-4.5,
openai.gpt-oss-120b,
openai.gpt-4.1,
openai.o4-mini
messages
(Message (content-block shape, recommended) · object | Message (legacy `{role, text}` shape, still accepted) · object)[]
required

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.

inference_config
object
required
tags
string[]

Response

OK

job_id
string<uuid>
required

The id of the job that has been enqueued.