Model API¶
This page describes how to access the Genesis model inference API, its endpoints, and the request parameters and response fields for each endpoint. The API follows OpenAI-compatible conventions. For key creation, console code generation, and viewing usage, see Guide · Genesis.
For errors and rate limits, see Error Codes. For built-in system models, see System Model Library.
Refer to the access information on the Genesis console’s Use page and actual API responses for paths, field names, and default values. Some endpoints, such as reranking, document recognition, and video generation, have no unified standard in the OpenAI protocol; refer to the live service for implementation details.
Access Information¶
Base URL¶
Obtain the Base URL from the Use page in the Genesis console. Example format (refer to the console for the actual domain and path segments):
https://moi.matrixorigin.cn/taas/v1
Path construction
Rule |
Description |
|---|---|
Version segment |
The Base URL usually already includes |
Request URL |
|
Important |
Do not append |
All paths in the tables below are relative to a Base URL that already includes the version segment.
Authentication¶
Use the same request-header authentication as OpenAI:
Authorization: Bearer <API_KEY>
When using the official OpenAI SDK, set
api_keyto the Genesis API Key andbase_urlto the Base URL above.Create API Keys in Genesis key management. A key can be bound to available models, rate limits, and quotas. Do not commit keys to a code repository.
Protocol Compatibility¶
Item |
Description |
|---|---|
Request fields |
Fields such as |
Response structure |
Structures such as |
SDK |
Use the official |
Endpoint Overview¶
Endpoint |
Method |
Path |
Description |
Billing Unit |
|---|---|---|---|---|
Chat completions |
POST |
|
Text conversations and generation; supports multimodal messages (image input) |
Tokens (including image token equivalents) |
Text embeddings |
POST |
|
Convert text to vectors |
Tokens |
Document reranking |
POST |
|
Rank candidate documents by relevance |
Tokens |
Document recognition |
POST |
|
Page-based document/image recognition |
Pages |
Image generation |
POST |
|
Generate images from text |
Images |
Video generation |
POST |
|
Generate videos from text or images |
Seconds |
Speech synthesis |
POST |
|
Convert text to speech |
Characters |
Speech recognition |
POST |
|
Convert speech to text |
Duration (minutes) |
Model list |
GET |
|
List the models available to the current key |
— |
Notes:
For visual understanding and image-based conversations, prefer multimodal messages with Chat Completions. Use Document Recognition for traditional page-based OCR.
For the range of endpoints currently covered by the console code generator, as well as extended endpoints such as Responses and Messages, see Integrate with the Genesis API. This page is primarily a parameter quick reference.
Chat Completions¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
Request Parameters¶
Parameter |
Type |
Description |
Default |
|---|---|---|---|
|
string |
Model ID, available from the model list or Model Marketplace |
— |
|
array |
Message list. Each message contains |
— |
|
number |
Sampling temperature, approximately 0–2 |
0.7 |
|
integer |
Maximum number of tokens to generate |
Model default |
|
boolean |
Whether to stream the response using SSE |
false |
|
number |
Nucleus sampling, in the range 0–1 |
0.9 |
|
number |
Frequency penalty, approximately −2–2 |
0 |
|
number |
Presence penalty, approximately −2–2 |
0 |
|
integer |
Random seed; fixing it makes the output reproducible for the same input |
Random |
Response Fields¶
Field |
Description |
|---|---|
|
Model response body |
|
|
|
Input tokens |
|
Output tokens |
|
Total tokens, used for billing reconciliation |
When stream is true, the response consists of multiple data: events. Incremental content is located at choices[0].delta.content, and the termination marker is data: [DONE].
Multimodal Messages¶
In the same endpoint, set a user message’s content to an array to combine text and images:
[
{"type": "text", "text": "Describe this image"},
{"type": "image_url", "image_url": {"url": "https://example.com/image.png"}}
]
image_url.url supports a public URL or the data:image/jpeg;base64,... format. prompt_tokens may include image tokens calculated based on image resolution.
Request Example¶
POST {Base URL}/chat/completions
Authorization: Bearer <API_KEY>
Content-Type: application/json
{
"model": "<model_id>",
"messages": [
{"role": "system", "content": "You are a rigorous data assistant."},
{"role": "user", "content": "Explain what data lineage is."}
],
"temperature": 0.7,
"stream": false
}
Text Embeddings¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Embedding model ID |
|
string or array |
A single text string or an array of text strings |
Response Fields¶
Field |
Description |
|---|---|
|
Vector; its dimensions are determined by the model |
|
Index corresponding to the batched input |
|
Billable usage |
Document Reranking¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
This endpoint has no unified standard definition in the OpenAI protocol. Refer to the actual API for field names and paths.
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Reranking model ID |
|
string |
Query text |
|
array |
List of candidate document strings |
|
integer |
Return the top N entries; all entries may be returned if omitted |
|
boolean |
Whether to return the original text in the results; defaults to true |
Response Fields¶
Field |
Description |
|---|---|
|
Results ordered by descending relevance |
|
Index corresponding to |
|
Relevance score, commonly in the range 0–1 |
|
Original text (when |
|
Billable usage (if returned) |
Document Recognition¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
This endpoint recognizes text in document pages or images. For visual conversation use cases, prefer the multimodal messages provided by Chat Completions.
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Document recognition model ID |
|
string |
Resource to recognize; refer to the API for the exact field name |
|
string |
Output format, such as |
Response Fields¶
Field |
Description |
|---|---|
|
Full recognized text |
|
Block-level results when |
|
Number of billable pages |
Image Generation¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Image generation model ID |
|
string |
Text prompt |
|
string |
Output dimensions, such as |
|
integer |
Number of images to generate, commonly 1–4; defaults to 1 |
|
string |
Negative prompt (if supported by the model) |
|
integer |
Random seed (if supported by the model) |
Response Fields¶
Field |
Description |
|---|---|
|
Generated image URL; it may expire, so copy the image to persistent storage promptly |
|
Number of billable images |
Video Generation¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
This endpoint usually uses an asynchronous task model. After submission, poll for the result or receive it through a callback. Refer to the actual API for its conventions.
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Video generation model ID |
|
string |
Text prompt |
|
string |
Source image URL for image-to-video generation (if supported) |
|
integer |
Duration in seconds, such as 5, 10, or 15 |
|
string |
Resolution, such as |
Response Fields¶
Field |
Description |
|---|---|
|
Task identifier |
|
Task status, such as |
|
Video URL after successful completion |
|
Number of billable seconds |
Speech Synthesis¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Speech synthesis model ID |
|
string |
Text to synthesize |
|
string |
Voice identifier |
|
string |
Audio format, such as |
|
number |
Speech rate, commonly in the range 0.5–2.0; defaults to 1.0 |
Response¶
Item |
Description |
|---|---|
Response body |
Usually a binary audio stream rather than JSON; |
Response headers |
May include a request identifier and fields related to billable characters; refer to the actual API |
Speech Recognition¶
Item |
Value |
|---|---|
Method |
POST |
Path |
|
Request Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Speech recognition model ID |
|
file |
Audio file (multipart); common formats include mp3, wav, and m4a |
|
string |
Language, such as |
|
string |
Output format, such as |
|
boolean |
Whether to return more granular timestamps (if supported) |
Response Fields¶
Field |
Description |
|---|---|
|
Full transcription |
|
Recognized language |
|
Audio duration in seconds, used for per-minute billing |
|
Segment information when |
Model List¶
Item |
Value |
|---|---|
Method |
GET |
Path |
|
No request body is required. The request must include valid authentication.
Response Fields¶
Field |
Description |
|---|---|
|
Model ID; use it as the |
|
Model type |
|
Availability status, such as |
For model selection guidance, see System Model Library.
Result Fields and Billable Usage¶
When implementing a client, prioritize reading:
Purpose |
Common Location |
|---|---|
Application result |
|
Usage for this request |
The |
Endpoint |
Billing Unit |
|---|---|
Chat completions, text embeddings, and document reranking |
Tokens |
Document recognition |
Pages |
Image generation |
Images |
Video generation |
Seconds |
Speech synthesis |
Characters |
Speech recognition |
Duration (minutes) |
For unit prices and Credit rules, see Costs and Billing and the Genesis pricing information.