TengoChatDevelopers

Quickstart: your first call

Make a key and get an answer in two minutes, with curl, JavaScript or Python.

1. Make a key

Open Create, Developers (sign up first if you have no account) and press New key. Copy it now: it is shown once. Your account starts with 2,000 free credits, enough for hundreds of calls.

Keep the key out of your code. Put it in an environment variable:

export TENGOCHAT_API_KEY="tc_live_..."

2. Make a call

curl https://tengochat.com/api/v1/chat/completions \
  -H "Authorization: Bearer $TENGOCHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "tengo-1", "messages": [{"role": "user", "content": "Say hello in three languages"}]}'

The answer has the text in choices[0].message.content, and what it used in usage: tokens, and the credits it cost.

3. Where to go next