Addis AI

Quick Start

Create an API key, install the SDK, and make your first request in four steps.

This guide takes you from a new account to your first Amharic response. Prefer to experiment without code first? Use the Playground guide.

Create an API key

  1. Open the API Keys Dashboard.
  2. Click Create API Key.

Addis AI API Keys page with the Create API Key button

  1. Name your key (e.g., Addis AI App) in the popup window.

Create API Key dialog with the key-name field

Important

You will see a key starting with sk_.... Copy this now.

You will not be able to see it again after closing the window.

New Addis AI API key confirmation with the one-time Copy action

Install the SDK and set your key

Keep the key on your server. The SDK reads it from ADDIS_API_KEY.

npm install addisai
export ADDIS_API_KEY="your_api_key"
pip install addisai
export ADDIS_API_KEY="your_api_key"
export ADDIS_API_KEY="your_api_key"

Make your first request

index.mjs
import AddisAI from "addisai";

const addis = new AddisAI();
const response = await addis.chat.completions.create({
  messages: [{
    role: "user",
    content: "ሰላም፣ ኢትዮጵያ ውስጥ ስንት ክልሎች አሉ?",
  }],
});

console.log(response.choices[0].message.content);
node index.mjs
main.py
from addisai import AddisAI

addis = AddisAI()
response = addis.chat.completions.create(
    messages=[{
        "role": "user",
        "content": "ሰላም፣ ኢትዮጵያ ውስጥ ስንት ክልሎች አሉ?",
    }],
)

print(response["choices"][0]["message"]["content"])
python main.py
curl https://api.addisassistant.com/api/v1/chat_generate \
  -H "Content-Type: application/json" \
  -H "x-api-key: $ADDIS_API_KEY" \
  -d '{
    "prompt": "ሰላም፣ ኢትዮጵያ ውስጥ ስንት ክልሎች አሉ?",
    "target_language": "am"
  }'

Check the response

The SDK prints the model's answer. Wording varies between runs:

በአሁኑ ጊዜ በኢትዮጵያ ውስጥ 12 ክልሎች አሉ።...

cURL returns the native JSON response, with the answer in response_text. See API overview for every response shape.

Next steps

Edit on GitHub

Last updated on

On this page