Amarsia
Client Usage

Quickstart

Send your first request in plain JSON and understand exactly what goes in and what comes back.

Start here

You only need 2 things:

  1. API key
  2. deployment ID (from your published assistant)

SDKs are coming soon. For now, use plain HTTP requests from any language.

The simplest request

This is the minimum valid request body:

{
  "content": [
    {
      "type": "text",
      "text": "Hello"
    }
  ]
}

The simplest API call

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": "Hello" }
    ]
  }'

What the API expects (input)

FieldTypeRequiredMeaning
contentarrayYesWhat you send to the assistant
content[].typestringYesInput kind (text, image, video, audio, url)
content[].textstringRequired for textYour message text
content[].mime_typestringRequired for filesFile type like image/jpeg
content[].file_uristringRequired for filesPublic URL of the file
variablesobjectNoValues for prompt variables

What the API responds with (output)

Regular endpoint returns:

{
  "content": "Hi! How can I help?",
  "model": "MODEL_NAME",
  "input_tokens": 12,
  "output_tokens": 24
}
FieldTypeMeaning
contentstring or objectAssistant output
modelstringModel used
input_tokensnumberTokens used for input
output_tokensnumberTokens used for output

Regular vs streaming

  • Regular API: full response at once
    POST /v1/runner/{deployment_id}
  • Streaming API: response arrives in chunks
    POST /v1/runner/{deployment_id}/stream