Three steps
Sign in to the console, select an enabled model and create a matching key. Follow the setup guide for the endpoint and model ID, and check your wallet balance and key quota before sending a request.
- 1Create an accountSign in and check your available balance and key quota before calling a model. Wallet shows current top-up availability.Sign up
- 2Create an API keyChoose an enabled model on the API Keys page and create a matching key. Set a spending limit if needed.See the walkthrough
- 3Send your first requestEnter the jeai endpoint, matching key and copied model ID, then check the configuration before calling.See the code
Create an API key
Restrict allowed source IPs for production; an allowlist does not replace credential security or other safeguards.
- Sign in to the console and open API Keys in the sidebar.
- Click Create API Key.
- Choose an enabled model and copy its model ID. Set a spending limit and expiry if needed.
- For production, enter the server’s outbound IP as permitted by the console.
- Save, then click Copy Key in the list to get your key starting with
sk-.
Base URL and key
Use this address with your jeai customer key. Your SDK or tool must support the selected model's protocol; the conversation examples below use Chat Completions:
Authorization: Bearer sk-your-keyGET https://api.jeai.xyz/v1/modelsCustomer keys and provider keys
| Key | Used by | Where to configure it |
|---|---|---|
| jeai customer API key | Your applications and tools, including WorkBuddy and Codex | Create it under API Keys in the customer console, then enter it in the tool |
| Official model provider key | The platform's connection to the upstream provider | Maintained by an administrator under Upstream Channels in the management console |
Create separate customer keys for applications or environments to control budgets and revocation. You usually do not need a separate key for each model. Enter a jeai customer key in your tools.
Send a request
This calls the chat endpoint. To switch to another enabled, authorized model compatible with this endpoint, change model and keep the same address and key. Replace example model IDs with entries from your available model list.
# pip install openai
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.jeai.xyz/v1", api_key=os.environ["JEAI_API_KEY"])
resp = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Introduce yourself in one sentence"}],
)
print(resp.choices[0].message.content)
// npm install openai
import OpenAI from "openai"
const client = new OpenAI({ baseURL: "https://api.jeai.xyz/v1", apiKey: process.env.JEAI_API_KEY })
const resp = await client.chat.completions.create({
model: "glm-5.3",
messages: [{ role: "user", content: "Introduce yourself in one sentence" }],
})
console.log(resp.choices[0].message.content)
curl https://api.jeai.xyz/v1/chat/completions \
-H "Authorization: Bearer $JEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [{"role": "user", "content": "Introduce yourself in one sentence"}]
}'
The usage field in the response is the token count of this call; that is what you are billed for:
{
"model": "glm-5.3",
"choices": [{ "message": { "role": "assistant", "content": "…" } }],
"usage": { "prompt_tokens": 14, "completion_tokens": 38, "total_tokens": 52 }
}Streaming
Add "stream": true and the answer arrives piece by piece, ideal for chat interfaces. Add stream_options to get usage at the end:
stream = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "Write a short poem about autumn"}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")
elif chunk.usage:
print("\nUsage:", chunk.usage)Image input
Choose an enabled model and route that support image input. Vision / Multimodal tags on the pricing page are reference information. Images can be provided as a URL or base64:
resp = client.chat.completions.create(
model="glm-5.3-flash",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": "https://example.com/cat.jpg"}},
],
}],
)Choose a model
Select the full model name in the console and copy its model ID. New keys are authorized for the selected model; use a matching key when choosing another model. Existing keys keep their actual permissions. The reference examples below do not mean every model is enabled:
| Vendor | Suggested model names | Good for |
|---|---|---|
| Zhipu GLM | glm-5.3 glm-5.3-flash | Writing, coding, agents; Flash is cheap and reads images |
| Doubao | doubao-seed-2-1-pro-260915 doubao-seed-2-1-lite-260915 | Multimodal understanding, everyday chat |
| Kimi | kimi-k3 kimi-k2.7-code | Very long documents, coding |
| DeepSeek | deepseek-v4-pro deepseek-flash | Reasoning, maths, code |
| Tencent Hunyuan | hy4-preview hy-mt2-pro | Agent tasks; translation |
| Qwen | qwen3.8-max qwen3.7-plus qwen-long | General chat; very long documents |
| Xiaomi MiMo | mimo-v2.6-pro mimo-v2.6-flash | Image, audio and video understanding |
| MiniMax | MiniMax-M3 | Reasoning, coding |
GET /v1/models returns models visible under your account, key permissions and billing configuration. The reference catalog can include models that are not connected. See model pricing for current specifications and prices.
What to check when switching
- The model is enabled. Use its exact model ID. A listed model is not a guarantee that its upstream route is healthy right now.
- Your key permits it. New keys are authorized for the selected model. Use a matching key for another model; existing keys retain their actual permissions. Your account must also have access to the model.
- Quota and access checks pass. Check account balance, key quota, expiry and IP allowlist.
- The tool supports its features. Chat, images, video, tools and Responses have different requirements. Each model entry needs the correct model ID and matching key. Confirm model compatibility before using Codex.
Use it in tools
Use the address required by your tool and an enabled, authorized model compatible with its protocol. Most chat tools use Chat Completions; Codex uses Responses. Address formats differ:
| Tool | Address to enter | Note |
|---|---|---|
| WorkBuddy | https://api.jeai.xyz/v1/chat/completions | Enter the complete chat endpoint |
| Codex | https://api.jeai.xyz/v1 | Include /v1; requires a Responses-compatible model |
| Cherry Studio | https://api.jeai.xyz | Adds /v1 by itself |
| Chatbox | https://api.jeai.xyz | Leave API Path empty |
| Dify | https://api.jeai.xyz/v1 | Must include /v1 |
| Cline (VS Code) | https://api.jeai.xyz/v1 | Must include /v1 |
WorkBuddy
Have your customer API key from the jeai console ready, then copy the exact ID of a currently available model to add a custom model.
Enter your jeai customer key
- Open WorkBuddy, click your avatar at the bottom left, then Settings → Model → Add model. Some versions also offer custom model settings through the model picker below the conversation.
- Set Provider to Custom.
- Enter the complete endpoint
https://api.jeai.xyz/v1/chat/completionsand your jeai customer API key. - Set Model name to the exact
model IDof a currently available model, matching the value accepted by the API. - Save, then select the new custom model in the conversation's model picker. If your version offers Test connection, use it to check that the endpoint, key and model match.
Switching models: Save a separate entry for each model with its exact model ID and matching key. New keys are authorized for the selected model; existing keys retain their actual permissions. Availability also depends on credit, tool compatibility and service status.
Official help: WorkBuddy model settings · Model and advanced options (Chinese).
Codex (CLI / desktop)
Use a jeai customer key with an enabled model confirmed to support Responses, incremental streaming and a complete tool-call loop. A reference price or a successful chat reply does not establish Codex compatibility.
- Install Codex. Prepare your jeai customer key and a confirmed compatible model ID. Use
https://api.jeai.xyz/v1as the base URL. - Open the user configuration:
~/.codex/config.tomlon macOS / Linux, or%USERPROFILE%\.codex\config.tomlon Windows. Merge the example below; update existing keys or tables instead of duplicating them, and preserve your other settings. - Replace
YOUR_CODEX_MODEL_IDwith the confirmed exact ID. Supply the customer key through theJEAI_API_KEYenvironment variable. Keep the real key out of TOML and repositories. - Launch
codexfrom the configured terminal and use/statusto check the provider and model. The desktop app reads the same user configuration; restart it and ensure its process can access the credential. - Start a new conversation with “Reply only: jeai-ok”, then check a small read-only tool task and a follow-up turn. Confirm the model and request in jeai Usage Logs. Test requests can incur usage charges.
# Keep top-level settings before the first [table]; use a confirmed model ID
model = "YOUR_CODEX_MODEL_ID"
model_provider = "jeai"
web_search = "disabled"
[model_providers.jeai]
name = "jeai"
base_url = "https://api.jeai.xyz/v1"
wire_api = "responses"
env_key = "JEAI_API_KEY"
Enter the base URL including /v1; Codex uses /v1/responses. Keep built-in web search disabled for the first connection check, and verify support before enabling it. If Codex does not recognize the model, obtain platform-supplied catalog metadata matching your client version and the model's actual capabilities. Do not enter a path to a file that does not exist.
How do I provide the key in a terminal?
After installing the CLI, macOS / Linux users can run this command and enter the key at the hidden prompt. Codex starts with the variable available to its process:
bash -c 'read -r -s -p "jeai API Key: " JEAI_API_KEY && export JEAI_API_KEY && exec codex'In Windows PowerShell, set the current process variable through secure input and launch the CLI:
$jeaiSecret = Read-Host "jeai API Key" -AsSecureString
$env:JEAI_API_KEY = [System.Net.NetworkCredential]::new("", $jeaiSecret).Password
codexAn app opened from a desktop icon usually does not inherit terminal variables. Use your system or client's supported credential setup for the app process, then check the desktop app separately. Do not share credentials when requesting help.
If tools fail, output does not finish or follow-up turns fail, check the model's Responses and tool support. Share only redacted errors and request IDs. Client configuration does not enable an upstream route, add model capabilities or grant local tool permissions.
Official help: Connect Codex to a model gateway · Responses and tool compatibility.
Cherry Studio
Request path: https://api.jeai.xyz/v1/chat/completions
- Click the Settings gear in the left sidebar and open Model Provider.
- Click "+ Add Provider" at the bottom of the list; Provider Name
jeai, API Key your key. - Under Endpoint settings, put
https://api.jeai.xyzin the OpenAI box (no /v1, no trailing /) and click Add. - The Choose models window opens: tick the models you want, or click "Add model manually" and type a name such as
glm-5.3. - Click "Verify and enable". Back in a chat, pick a model under jeai and start talking.
Chatbox
Preview: https://api.jeai.xyz/v1/chat/completions
- Open Chatbox, click Settings at the bottom left and open Model Provider.
- Click Add at the bottom of the list; Name
jeai, API Mode "OpenAI API Compatible", then Add. - API Key your key, API Host
https://api.jeai.xyz, API Path empty; Preview should readhttps://api.jeai.xyz/v1/chat/completions. - In the Model area click Fetch to pull the list, or New to enter a Model ID such as
deepseek-flash. - Click Check next to API Key and test a model; "Connection successful!" means you're set. Start a new chat and choose a jeai model under Select Model.
Dify
- Click Integrations at the top and open Model Provider (older versions: avatar → Settings → Model Provider).
- Install OpenAI-API-compatible from "Install model providers", then click Add Model on its card.
- Model Type LLM; Model Name exactly the model name, e.g.
glm-5.3. - API Key your key; API Base URL
https://api.jeai.xyz/v1(with /v1); Model context size from the Context column on the pricing page. - Click Add. Dify sends a test request first and saves if it passes. The model then appears in your apps' model picker; add each model you want to use.
Cline (VS Code)
- Open the Cline panel in VS Code, click the gear at the top right and go to API Configuration.
- Set API Provider to OpenAI Compatible.
- Base URL
https://api.jeai.xyz/v1(with /v1); OpenAI Compatible API Key your key. - Cline then fetches the model list; pick one under Model ID —
kimi-k2.7-codeorglm-5.3work well for coding. "Use custom model ID…" lets you type one. - Settings save automatically; click Done. Send Cline a message — a normal reply means it works.
Environment and frameworks
The official OpenAI SDKs (Python, Node.js) read these two environment variables, so your code no longer needs the address or key:
OPENAI_BASE_URL=https://api.jeai.xyz/v1
OPENAI_API_KEY=sk-your-keyIn LangChain, LlamaIndex and similar frameworks, pick the OpenAI model class and fill in the same address and key:
# pip install langchain-openai
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="kimi-k2.6", base_url="https://api.jeai.xyz/v1", api_key="sk-your-key")
print(llm.invoke("Hello").content)Before going live
- Keep keys on the server. Never put them in web pages, app bundles or public repositories; anyone can read code that runs in a browser.
- One key per app. Give each its own quota and expiry so a problem only affects one app.
- Set an IP whitelist in production. Each entry is a single IP or a range no wider than /24.
- Handle the specific error. Back off as instructed for 429. After a timeout, disconnect or unknown task state, check logs and task status before resubmitting to avoid duplicate charges. For other 4xx, check the request first.
Requests may be limited by the key, account, gateway or model provider. Handle 429 according to its specific cause. If a key is paused or an account is restricted, check the notice and logs and follow the applicable recovery process instead of retrying repeatedly.
Usage and reconciliation
Usage analysis in the console shows input, output, total tokens, billed requests and charges by model. Logs show individual calls; statement details show spending and balance changes. Select the same time range when comparing records.
A platform request ID links a call to the platform’s logs. Read it from X-Oneapi-Request-Id when available. The provider decides whether to supply an upstream request ID; a platform ID or dashboard entry is not itself a provider-signed usage receipt.
import requests
r = requests.post("https://api.jeai.xyz/v1/chat/completions",
headers={"Authorization": "Bearer sk-your-key"},
json={"model": "deepseek-flash", "messages": [{"role": "user", "content": "hello"}]})
request_id = r.headers.get("X-Oneapi-Request-Id") # same ID as in Usage Logs
usage = r.json()["usage"]
print(request_id, usage["prompt_tokens"], usage["completion_tokens"])Look for the platform request ID in streaming response headers. Compatible text endpoints can request final usage data with stream_options.include_usage; available fields and whether usage is returned depend on the provider and endpoint. Check logs after a disconnect.
Error codes
Errors come back with an HTTP status and JSON like this. message gives the reason; send us the request ID at the end and we can look it up:
{
"error": {
"code": "insufficient_user_quota",
"message": "… (request id: 20261019…)",
"type": "new_api_error"
}
}| Status | What happened | What to do |
|---|---|---|
| 400 | The request is malformed, or a parameter is not supported by this model (e.g. the conversation exceeds the context) | Check the body; trim older turns from long conversations |
| 401 | The key is missing, wrong, disabled (including auto-paused) or expired | Check the Authorization header; look at the key in the console and re-enable it if needed |
| 403 | Your balance is too low, or the call came from an IP outside the key's whitelist | Check balance and top-up availability in Wallet, or review the key's IP allowlist |
| 429 | The request rate or concurrency reached a key, account, gateway or upstream limit | Reduce concurrency and wait as directed before retrying; an IP allowlist does not bypass limits or guarantee that a key will never be paused |
| 503 | The model name is wrong, or the model has no available route right now (model_not_found) | Check the name with GET /v1/models; retry later |
| 500 / 502 / 504 | The upstream model failed or timed out | Retry later; if it keeps happening, see service status |
FAQ
Do I need another API key when choosing another model?
New customer keys are authorized for the model selected in the console. Use or create a matching key for another model and update the model ID in your tool. Existing keys retain their actual permissions. See the switching checklist.
Should I enter a provider key or a jeai key in my tool?
Enter a key created under API Keys in the jeai customer console. Official provider keys are maintained by platform administrators under Upstream Channels. See customer and provider keys.
My key was paused. What should I do?
Check the logs, recent calls and stated reason. Follow the actions available in the console; an administrative restriction requires manual review. If the key leaked, disable it, create another one and check where credentials were exposed. An IP allowlist restricts sources but does not guarantee security or exempt a key from limits.
My balance or key quota is insufficient.
Check the active account, Wallet balance and the key's remaining quota. A key's own spending limit can also block a request. Funds must be credited before use; Wallet shows current top-up availability.
The model is unavailable (model_not_found).
Copy the exact ID of an enabled model from the console and check that your key matches it. Also check route availability, wallet balance and key quota. Models listed only in the reference catalog may not be callable.
Requests are slow or disconnect midway.
Check service status and the call’s logs. Reasoning and generation can both take time; use streaming when supported. A timeout or disconnection does not prove the upstream did not execute the request. Check records and task status before retrying to avoid duplicate calls.
It says the context is too long.
Each model accepts a different length; see the Context column on the pricing page. Keep only the latest turns of long conversations, or switch to a 1M-context model.
How do I check charges by model and by request?
Usage analysis shows input, output, total tokens, requests and charges for each model. Logs can be filtered by model and key; statement details show balance changes. Use the same date range when comparing records.
Where can I check balance, refunds and invoices?
Wallet shows balance and credited funds. Unused paid principal is refunded promptly after verification. After use, eligible remaining paid principal is checked and processed within 14 calendar days of the request under the agreement. Invoices depend on the services actually available and confirmed arrangements. See the user agreement for conditions and limits.
Can our business request a tailored plan?
Apply for enterprise verification to discuss a plan suited to your needs. Dedicated pricing, routes and invoices depend on review, confirmation and actual activation; a label or group alone does not enable them. See Enterprise.