Amarsia
API Reference

Runner API

Main endpoint for sending input to a deployed assistant and getting output.

What Runner API is

Runner API is the core "ask assistant" API.

You send content, assistant sends back output.

POST /v1/runner/{deployment_id}

Use this when you want one complete response.

Request body

FieldTypeRequiredMeaning
contentarrayYesUser input items
variablesobjectNoPrompt variable values

content item types

typeRequired fields
texttext
imagemime_type, file_uri
videomime_type, file_uri
audiomime_type, file_uri
urlmime_type, file_uri

Example request

curl https://api.amarsia.com/v1/runner/YOUR_DEPLOYMENT_ID \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "content": [
      { "type": "text", "text": "Explain this in simple words." }
    ],
    "variables": {
      "tone": "friendly"
    }
  }'

Example response

{
  "content": "Sure. Here is a simple explanation...",
  "model": "MODEL_NAME",
  "input_tokens": 35,
  "output_tokens": 72
}

Response fields

FieldTypeMeaning
contentstring or objectAssistant output
modelstringModel used to generate answer
input_tokensnumberInput token usage
output_tokensnumberOutput token usage

POST /v1/runner/{deployment_id}/stream

Use this when you want output as it is generated.

Request body

Same structure as regular endpoint.

Example request

curl -N https://api.amarsia.com/v1/runner/YOUR_DEPLOYMENT_ID/stream \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "content": [
      { "type": "text", "text": "Stream this response." }
    ]
  }'

Stream behavior

  • You receive chunks in order
  • Concatenate chunks to render full text
  • Best for chat UI and low-latency UX