IsraelGPT API Docs Get an API key

Examples

The basic request, then a few common patterns: continuing a conversation, picking a persona, media, and retrying safely.

Basic request

curl -X POST https://www.israelgpt.site/api/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -A "MyApp/1.0" \
  -d '{
    "messages": [{ "role": "user", "content": "What time is it in Tel Aviv?" }],
    "personaId": 1,
    "selectedModel": "israelbot-1",
    "effort": "low"
  }'

"Give to your AI agent" copies a full plain-text spec of this API (auth, parameters, response shape, errors) — paste it into Claude Code, Cursor, or any coding assistant and ask it to wire up the integration for you.

Continuing a conversation

Nothing is kept between calls: send the conversation you want the model to see, oldest first. Keep each reply's sig and send it back with that reply, so the model knows it really said it (see API Reference):

history = []

def ask(text):
    history.append({"role": "user", "content": text})
    data = httpx.post(
        "https://www.israelgpt.site/api/v1/chat",
        headers={"Authorization": "Bearer YOUR_API_KEY", "User-Agent": "MyApp/1.0"},
        json={"messages": history[-40:]},
        timeout=60,
    ).json()
    if "sig" in data:
        history.append({"role": "assistant", "content": data["reply"], "sig": data["sig"]})
    else:
        history.pop()  # blocked: don't keep the question
    return data["reply"]

ask("What's the capital of Israel?")
ask("And the largest city?")

Replies sent back without their sig still work, but the model reads them as quotes from your app, not its own words, and unverified_replies in the answer counts them.

Picking a persona and model

The full lists are on Personas & Models. The Tsundere persona (id 9) on IsraelBot 1, at High effort:

{
  "messages": [{ "role": "user", "content": "Help me plan a trip to Eilat." }],
  "personaId": 9,
  "selectedModel": "israelbot-1",
  "effort": "high"
}

YahooBot 1 for code, kept short for a chat app:

{
  "messages": [{ "role": "user", "content": "Write a Python function that reverses a string." }],
  "selectedModel": "yahoobot-1",
  "longMode": false
}

Uncensored mode

{
  "messages": [{ "role": "user", "content": "Roast my code review." }],
  "uncensoredMode": true
}

The Terms of Service's content rules apply either way: it changes the language, not what's allowed.

Media in the answer

When the reply uses [IMAGE], [music] or [podcast], media has the links, ready to post or play:

const data = await res.json();

for (const image of data.media?.images ?? []) console.log("picture:", image.url);
for (const song of data.media?.music ?? []) console.log("song:", song.title, song.url);
if (data.media?.podcast) console.log("podcast episode:", data.media.podcast.url);

Only text wanted? Turn the key's Media setting off on the dashboard, and there are no tags and no media.

Retrying safely

A small retry loop that waits on 429, 502 and 503, and gives up on anything else (a 400 or 401 won't fix itself):

import httpx
import time

def ask(messages, max_attempts=3):
    for attempt in range(max_attempts):
        response = httpx.post(
            "https://www.israelgpt.site/api/v1/chat",
            headers={"Authorization": "Bearer YOUR_API_KEY", "User-Agent": "MyApp/1.0"},
            json={"messages": messages},
            timeout=60,
        )
        if response.status_code == 200:
            return response.json()

        if response.status_code == 429:
            wait = response.json()["error"].get("retry_after_seconds", 5)
        elif response.status_code in (502, 503):
            wait = int(response.headers.get("Retry-After", 2 ** attempt))
        else:
            response.raise_for_status()  # 4xx: fix the request instead

        time.sleep(wait)

    raise RuntimeError("Gave up after retries")

Plain text only

For somewhere that only shows text, strip the tags only the web chat can show. This is what the reference bot does:

import re

STRIP_TAG_RE = re.compile(
    r"\[(ACTION:[^\]]*|flashcard:[^\]]*|QUESTION:[^\]]*|create-file:[^\]]*|"
    r"LGBTQ_IMG|musor_drop|download|IMAGE(\?[^\]]*)?|music(\?[^\]]*)?|podcast)\]",
    re.IGNORECASE,
)

clean_text = STRIP_TAG_RE.sub("", data["reply"]).strip()