๐ YingCore Integration Guide
๐ค Best for: Developers and teams who need to plug the platform into their own systems
โฑ๏ธ Reading time: about 8 minutes
๐ก In one sentence: Use the OpenAI protocol to call every configured model through one unified API.
YingCore exposes an OpenAI-compatible API. You can integrate with any language or SDK that supports the OpenAI protocol, and call every model that is configured on the platform.
1. Get an API Keyโ
- Log in to the platform โ click "Get API" at the top.
- In the API Key area, click "Create" to generate a platform token.
- Copy and save the Key and the Base URL:
- Base URL:
https://your-platform-url/platform-api/v1 - API Key:
YOUR_API_KEY
- Base URL:
The Key is only fully visible when it is created โ save it right away. Treat the Key as a secret credential.
2. List Available Modelsโ
Before calling, fetch the model list to confirm which model IDs are available:
GET https://your-platform-url/platform-api/v1/models
Authorization: Bearer YOUR_API_KEY
The response includes each model ID, vendor, type, context length, and capability tags. Use a model ID from the list as the model field in chat requests.
3. Code Samples in Four Languagesโ
Pythonโ
from openai import OpenAI
client = OpenAI(
base_url="https://your-platform-url/platform-api/v1",
api_key="YOUR_API_KEY",
)
resp = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
cURLโ
curl https://your-platform-url/platform-api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-chat","messages":[{"role":"user","content":"Hello"}]}'
Node.jsโ
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://your-platform-url/platform-api/v1",
apiKey: "YOUR_API_KEY",
});
const resp = await client.chat.completions.create({
model: "deepseek-chat",
messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);
Javaโ
import com.theokanning.openai.OpenAiService;
import com.theokanning.openai.completion.chat.*;
// baseUrl points to the platform
OpenAiService service = new OpenAiService("YOUR_API_KEY", Duration.ofSeconds(60));
// Configure baseUrl: https://your-platform-url/platform-api/v1
All four languages integrate through the official OpenAI SDK โ you only need to change
base_urlandapi_key. The exact class names depend on the SDK version you use.
4. Push API Config to a Clientโ
The Get API page also offers a Push API action so any registered client (such as YingClaw) can use platform models in one click:
- In the Push API area, pick the target client device (filter by user email).
- Pull the global / user configuration.
- Click "Quick Fill" to auto-populate:
- api_key โ the Key assigned to the client.
- default_provider โ
custom:http://122.114.233.81/platform-api/v1/chat/completions(subject to your deployment). - default_model โ for example
deepseek-chat.
- Click Push to Client โ the client is now wired up.
5. Embed on an External Siteโ
To embed the platform chat assistant into your own website:
- In the Workbench, open the app card menu and choose "Embed on Site".
- Generate the iframe embed code (
/chat/share?shared_id=...) โ you can hide the avatar, set the language, and so on. - Paste the code into your web page.
Some embed modes (partial embed / browser extension) are marked as "coming soon".
6. Integration Notesโ
- Protocol: Compatible with the OpenAI protocol โ minimal changes to existing OpenAI code.
- Authentication: Request header
Authorization: Bearer <API_KEY>. - Usage: View call counts and Token consumption under Get API โ Usage Statistics; admins can view usage per user or tenant in YingClaw.
- Rate limits: If you hit a rate limit or quota issue, contact the platform admin to adjust.
- Model availability: A model is callable only if it has been configured and enabled in Model Providers. Unconfigured models cannot be called.