JYI AI developer documentation
For signed-in JYI AI customers: the gateway API, model boundaries, key handling,
billing and request troubleshooting.
Quickstart
- Sign in to the JYI console and create an API key. It is shown once; store it in an environment variable such as
JYI_API_KEY.
- Point your OpenAI-compatible client at
https://gateway.jyisolutions.com/v1 and use the JYI key as the Bearer token.
- Call
GET /v1/models and copy an exact model ID. The list contains published models available to your account.
- Send one request with curl or the SDK, then add streaming or tools after the first response succeeds.
OpenAI SDK example
pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.jyisolutions.com/v1",
api_key=os.environ["JYI_API_KEY"],
)
reply = client.chat.completions.create(
model="MODEL_ID_FROM_V1_MODELS",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)
API reference
Gateway base URL: https://gateway.jyisolutions.com/v1
All /v1 requests use
Authorization: Bearer <JYI_API_KEY>, except OPTIONS preflight.
The model list only returns published models your account may use.
| Method | Path | Purpose |
GET | /v1/models | Lists available model IDs, capabilities, context limits and verified request parameters. |
POST | /v1/chat/completions | OpenAI Chat Completions format; JSON, SSE streaming and tool calls where the model supports them. model and messages are required. |
POST | /v1/responses | OpenAI Responses format; synchronous JSON, SSE streaming, function tools and inline images on supported models. Send the full context each time; response history is not stored. |
GET | /v1/requests/{id} | Reads request status, usage and settlement for the same API key, using the X-JYI-Request-ID from the original response. |
Compatibility scope: the gateway implements the four endpoints above. Responses history,
previous_response_id, background jobs and persistence are not supported.
Other OpenAI endpoints such as Embeddings, Files and image generation return 404.
Request example
curl -sS "https://gateway.jyisolutions.com/v1/responses" \
-H "Authorization: Bearer $JYI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID_FROM_V1_MODELS","input":"Hello"}'
Errors and request status
JSON errors use { "error": { "message", "type", "code" } }. Common statuses:
400 — invalid parameter, model ID or unsupported model capability.
401 — key missing, invalid, expired or revoked.
402 — insufficient balance or connection quota.
403 — account inactive or not allowed to use this model.
404 — endpoint does not exist, or the request ID is outside this key's scope.
413 — request body exceeds the gateway size limit.
429 — too frequent or service busy; honour Retry-After, otherwise use exponential backoff.
5xx — gateway or upstream error; save X-JYI-Request-ID and check request status first.
For a timeout or ambiguous 5xx, check the request ID before retrying.
authorized means processing is ongoing; needs_review means the
outcome is being checked. Do not retry blindly.
Models, prices and billing
Read /v1/models when integrating or deploying. The signed-in Models page
shows the current catalogue, capability filters, context limits and reference prices per
million tokens; some models also charge per request, image or cache. Model-page estimates
are for planning, not reconciliation — the billing ledger is the settlement record.
The gateway reserves credit before forwarding a request, then settles against reported
usage. If the upstream outcome cannot be confirmed, the request stays under review instead
of guessing the charge. Insufficient balance or device quota generally returns 402;
account status or model permission issues return 403.
Production setup and key safety
Do not commit a JYI key to source control, public logs, browser code or shared
configuration. Store it in a secret manager or environment variable. A key is shown only
when created and cannot be recovered; rotate or revoke it instead. Use separate keys for
different devices or purposes.
Use "Connect JYI" OAuth in a JYI client. In general OpenAI-compatible tools, configure the
gateway URL and a JYI key. On 429 honour Retry-After; check request status
before resubmitting after a timeout or 5xx.
Developer FAQ
What is the gateway base URL?
https://gateway.jyisolutions.com/v1. Every request uses Authorization: Bearer JYI_API_KEY, except OPTIONS preflight.
Which OpenAI endpoints are supported?
The gateway implements /v1/models, /v1/chat/completions, /v1/responses and /v1/requests/{id}. Responses history, previous_response_id and background jobs are not supported. Other OpenAI endpoints such as Embeddings, Files and image generation return 404.
How do I find a usable model ID?
Call GET /v1/models and use the exact id from the response. The list contains published models available to your account; model names and capabilities can change, so read it when integrating or deploying.
Does the gateway store conversation history?
No. Send the full context in every request. previous_response_id, background jobs and stored response history are not supported. Prompt and image content is sent to the model provider that serves the request, as the privacy notice describes.
How is a request billed?
Accounts use prepaid credit. The gateway reserves credit before forwarding a request, then settles against reported usage. Reference rates are on the Models page and the billing ledger is the settlement record; estimates are for planning, not reconciliation.
Can I keep using an OpenAI SDK?
Yes. Point the SDK base URL at the gateway /v1 and use a JYI key as the API key. Request shapes stay the same; model IDs still come from /v1/models.
Can I use OpenCode with JYI?
Yes, as a custom OpenAI-compatible provider: set baseURL to the gateway /v1, add your JYI key as apiKey, then choose a published model. There is no official JYI plugin and native JYI OAuth is not supported, so paste the key by hand.
What should I do after a timeout or 5xx?
Keep the X-JYI-Request-ID and read /v1/requests/{id} with the same key before retrying. authorized means processing is ongoing; needs_review means the outcome is being checked. Do not resubmit blindly, because the upstream call may already have been charged.
Which image inputs are accepted?
Image input is limited to supported DeepSeek Flash routes: up to five JPEG, PNG or WebP base64 data URLs in user messages. External image URLs, audio, video and file input are currently rejected.
Service terms · Privacy notice ·
JYI AI home. Enable JavaScript to use the full console and interactive docs.