Using AI APIs
Në shqip: Përdorimi i API-ve të AI
ShpjegimiSQ
Mund ta futësh një LLM në aplikacionin tënd përmes API-së (Anthropic, OpenAI, Google): dërgon mesazhet, merr përgjigjen. Paguan sipas token-ave. Mos e vendos kurrë çelësin e API-së në kodin e frontend-it.
EnglishEN
You can put an LLM inside your app through an API (Anthropic, OpenAI, Google): send messages, get the reply. You pay per token. Never put the API key in frontend code.
Si ta mendosh
Si të telefonosh një ekspert sa herë të duhet, dhe të paguash për minutë.
Lexoje në anglisht
Like phoning an expert whenever you need one and paying by the minute.
Shembull kodipython
import anthropic
client = anthropic.Anthropic()
msg = client.messages.create(model="claude-sonnet-5-5", max_tokens=300,
messages=[{"role": "user", "content": "Shpjego rekursionin shkurt"}])