JEAIAPI

YOUR APP. YOUR JEAI.

Build with JEAI.

Connect your program to JEAI. Create a personal API key, choose an example, and send your first question. No admin login required.

Up to 3 new keys per IP address in 24 hours. Reuse your existing key for further requests.

POSThttp://192.168.0.43:4043/v1/chat/completions

THREE SIMPLE STEPS

Your first answer.

  1. Create and save your key

    Use the button above. The new key is shown once. Keep it private; it is separate from your admin password.

  2. Choose an example

    Pick Python, HTML/JavaScript, Ubuntu Bash or Windows PowerShell below. Copy the complete code or download the file.

  3. Run it and enter your key

    Follow the command shown for your example. Enter the key when asked. Change the question in messages to use JEAI in your own program.

Your program must be able to reach the controller on your local network or VPN. The address 192.168.0.43 is not a public internet address.

COPY. RUN. BUILD.

Examples

Examples use the selected profile and page language. They request a complete JSON response and never include your real key automatically.

jeai_test.py
import getpass
import json
import os
import urllib.error
import urllib.request

API_URL = "http://192.168.0.43:4043/v1/chat/completions"
api_key = (os.environ.get("JEAI_API_KEY") or getpass.getpass("JEAI API key: ")).strip()
if not api_key:
    raise SystemExit("Enter your JEAI API key.")

payload = {
    "model": "auto",
    "messages": [{"role": "user", "content": "Reply briefly: JEAI works."}],
    "language": "en",
    "stream": False,
    "web": False,
}
request = urllib.request.Request(
    API_URL,
    data=json.dumps(payload).encode("utf-8"),
    headers={"Authorization": "Bearer " + api_key, "Content-Type": "application/json"},
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=1800) as response:
        result = json.load(response)
    print(result["choices"][0]["message"]["content"])
except urllib.error.HTTPError as error:
    raise SystemExit(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}")
except (urllib.error.URLError, TimeoutError) as error:
    raise SystemExit(f"Connection failed: {error}")
How to run

Save as jeai_test.py. Python 3 is sufficient; no extra packages are needed.

Windows: py jeai_test.py
Ubuntu:  python3 jeai_test.py

The HTML example is for your own local test. Never publish a shared API key inside website code. A public app should keep its key on its own backend.

THE IMPORTANT DETAILS

Reference

Authentication

Send these headers with every API request. Replace YOUR_JEAI_API_KEY with your personal key.

Authorization: Bearer YOUR_JEAI_API_KEY
Content-Type: application/json

Read the answer

For stream: false, the answer is in this JSON field:

result["choices"][0]["message"]["content"]

The API does not remember earlier calls. Include previous user and assistant messages in messages for a conversation.

Request fields

FieldMeaning
modelauto chooses a suitable JEAI service. You can also use a profile name or ID from the list below.
messages1–20 text messages with role and content. Roles: system, user, assistant. The last nonempty message must be from user. Total input: up to 24,000 characters; the model context may require shorter text.
languageen, de, es, fr, it, nl, pl, tr or auto. The default is en; auto follows the last question.
streamfalse returns one JSON response. true returns SSE chunks in choices[0].delta.content, ending with data: [DONE]; that requires a streaming client.
webfalse by default. true enables web research for the request; search text is sent to external search services.
speedOptional, 0–100. Default 55. Higher values request shorter explanations; they do not increase hardware performance.
max_tokensOptional output limit, clamped to 1–2048 tokens. Omitting it uses the profile limit and speed preference. The model's context can limit it further.

Your JEAI profiles

These entries come from this controller's configuration. GET /v1/models returns the same profile list with a Bearer key; the list alone does not indicate whether a model is online.

JEAI profileModel ID
MsM 1msm-1
BM 1bm-1

Several users can submit questions to the same profile. Busy services queue requests within the configured limits. Wait for the reply instead of sending the same question again.

If something does not work
401
Check the key and the Authorization: Bearer header. An admin password is not an API key.
400 / 413
Read error.message in the response. Check the JSON fields and shorten long messages or conversation history.
429
A key limit was reached, the queue is full, or no suitable model is currently available. Read the error and check the model status before retrying.
502 / 503
Check the controller and workers. The service may be locked or unavailable.
Failed to fetch
Check the address and network, then open the controller in the browser. In the console, check for CORS, mixed-content or local-network permission errors. An HTTPS website may not access this HTTP API; serve the HTML test on localhost as described above.

JEAI · IMAGE API

Bildmodelle / Image models

Der gleiche persönliche JEAI-API-Schlüssel funktioniert für Text und Bilder. Modelle: vm-1 (512 × 512), vm-2 (768 × 768), vm-2-ultimate-x (1024 × 1024). Auf der Chatseite: /Picture [VM-1] ein Sternenhimmel, /Picture [VM-2] ... oder /Picture [VM-2 Ultimate X] ....

Use your JEAI Bearer key. Check installed models with GET /v1/images/models. The queue may take several minutes. Create a job:

curl -sS -X POST http://192.168.0.43:4043/v1/images/generations \
  -H "Authorization: Bearer $JEAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"vm-1","prompt":"A blue violet galaxy","async":true}'

The result returns id. Poll GET /v1/images/jobs/ID using the same Bearer key until status is done. Download the PNG with GET /v1/images/jobs/ID/content (same key). For an OpenAI-style JSON answer omit async: POST /v1/images/generations responds with data[0].b64_json when complete. Long requests can outlive app timeouts; async is recommended.

Protect your key. API images are private to their key; browsers need their own server to call this endpoint safely. For access outside your network, use a VPN or HTTPS proxy.