Get started

Quickstart

Send your first request

Three steps. You need an Antarya account and a terminal.

  1. Create a key. Open Keys in your account and choose Create key. Copy it now; it is shown once.
  2. Set it as ANTARYA_API_KEY in your shell: export ANTARYA_API_KEY=ak-... on macOS and Linux, or $env:ANTARYA_API_KEY = "ak-..." in PowerShell.
  3. Send a request. Pick your language below. Each sample asks one question and prints the reply. For Python, run pip install antarya first; for TypeScript, npm install antarya; for the CLI, see the CLI page.
curl https://antarya.ai/v1/chat \
  -H "Authorization: Bearer $ANTARYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Summarise the termination clause of this contract."}
    ]
  }'
Output
{
  "id": "req_01",
  "content": [
    {"type": "text", "text": "Either side can end the agreement with written notice..."}
  ],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 18, "output_tokens": 64}
}

What came back

The reply is in content. stop_reason says why the reply ended, and usage gives the tokens you were billed for. To continue the conversation, send the whole messages list again with the reply added as an assistant message.

To ask about a document or a picture, put a file or an image in the message next to the text. See files and images.

Next steps