Modules

AI travel assistant API

Add Tara, Tratok's AI travel assistant, to your app with one call. Give each of your users a conversation of their own, and Tara remembers what was said in it.

1call to send a message
20messages remembered
2methods
TRATpaid per answer

These figures are counted from the data the API answers from.

What you get

One call

Send the user's message and get Tara's reply, in the language the user wrote in.

A memory per user

Pass the same conversationId for the same user and Tara keeps the thread. Another method clears it.

Costs you can see

Every answer says how many tokens it used and what it cost, and a call you cannot pay for is refused before it runs.

A call and its answer

curl -X POST https://developer.tratok.net/v1/ \
  -d "request=taraChat" \
  -d "id=YOUR_APP_ID" \
  -d "secret=YOUR_SECRET" \
  -d "conversationId=user-42" \
  -d "maxTokens=500" \
  -d "message=What should I pack for Lisbon in March?"
{
  "status": "Ok",
  "assistant": "Tara",
  "reply": "March in Lisbon is mild and can be showery...",
  "conversationId": "user-42",
  "usage": {
    "inputTokens": 412,
    "outputTokens": 198,
    "totalTokens": 610,
    "cost": 1.204,
    "currency": "TRAT",
    "maxTokens": 500,
    "truncated": false
  }
}

An illustration of the shape of the answer. Your own call returns the real text.

Good to know

  • Tara is paid per answer: 1 TRAT per 1,000 input tokens and 4 TRAT per 1,000 output tokens. Tara is not part of the free calls, so it needs a TRAT balance.
  • Before each answer your balance must cover the input plus the longest answer allowed. Send maxTokens, from 200 to 10,000, to choose that length: with 500 the answer part is 2 TRAT, without it 40 TRAT. An answer that reaches the length is cut off and marked truncated.
  • 1,000 free calls every calendar month for every module except Tara AI, then 0.01 TRAT a call.
  • A key is issued after a person has read your request. We usually answer within one working day.

The methods

Questions

What does Tara cost?

Tara is paid per answer in TRAT: 1 TRAT per 1,000 input tokens and 4 TRAT per 1,000 output tokens. Each answer reports its own cost.

Is Tara part of the free calls?

No. The 1,000 free calls a month cover every module except Tara AI.

Does Tara remember earlier messages?

Yes, within a conversation: pass the same conversationId and the last 20 messages are kept. The taraReset method clears a conversation.

How much TRAT do I need to try Tara?

Send maxTokens to choose the longest answer. With maxTokens 500, about 4 TRAT in your balance is enough for a first short question; without maxTokens it takes about 42 TRAT. You pay only for the tokens actually used.

The other modules