curl --request POST \
--url https://gengen.farm/api/gengen/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seed-2-0-lite-260428",
"messages": [
{
"role": "user",
"content": "Write a concise product summary."
}
]
}
'
{
"id": "chatcmpl-example",
"object": "chat.completion",
"model": "seed-2-0-lite-260428",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is a concise summary."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 128,
"completion_tokens": 32,
"total_tokens": 160
}
}{
"error_code": "gengen.model_required",
"error_params": {
"field": "model"
},
"error": "A model is required"
}{
"error_code": "gengen.auth_required",
"error": "Missing Authorization bearer token"
}{
"error_code": "seedance.insufficient_balance",
"error": "Insufficient available balance"
}{
"error_code": "gengen.api_key_revoked",
"error": "GENGEN API key has been revoked"
}{
"error_code": "<string>",
"error_params": {
"failedAsset": {
"url": "<string>",
"field": "assets.referenceImages",
"index": 1,
"mediaType": "Image",
"stage": "validation"
}
},
"error": "<string>"
}Text API
Create a chat completion
Create an OpenAI-compatible BytePlus chat completion. Set stream to
true to receive Server-Sent Events ending with data: [DONE]. For a
streaming request, GENGEN always enables final usage reporting.
POST
/
chat
/
completions
curl --request POST \
--url https://gengen.farm/api/gengen/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seed-2-0-lite-260428",
"messages": [
{
"role": "user",
"content": "Write a concise product summary."
}
]
}
'
{
"id": "chatcmpl-example",
"object": "chat.completion",
"model": "seed-2-0-lite-260428",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is a concise summary."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 128,
"completion_tokens": 32,
"total_tokens": 160
}
}{
"error_code": "gengen.model_required",
"error_params": {
"field": "model"
},
"error": "A model is required"
}{
"error_code": "gengen.auth_required",
"error": "Missing Authorization bearer token"
}{
"error_code": "seedance.insufficient_balance",
"error": "Insufficient available balance"
}{
"error_code": "gengen.api_key_revoked",
"error": "GENGEN API key has been revoked"
}{
"error_code": "<string>",
"error_params": {
"failedAsset": {
"url": "<string>",
"field": "assets.referenceImages",
"index": 1,
"mediaType": "Image",
"stage": "validation"
}
},
"error": "<string>"
}Body
application/json
OpenAI-compatible chat completion request. Additional chat settings depend on the capabilities of the selected model.
Supported GENGEN LLM model IDs:
dola-seed-2-1-turbo-260628— Seed 2.1 Turboseed-2-0-mini-260428— Seed 2.0 Miniseed-2-0-lite-260428— Seed 2.0 Liteseed-2-0-pro-260328— Seed 2.0 Proseed-2-0-code-preview-260328— Seed 2.0 Code Previewdeepseek-v4-flash-260425— DeepSeek V4 Flashdeepseek-v4-pro-260425— DeepSeek V4 Proglm-5-2-260617— GLM 5.2
Available options:
dola-seed-2-1-turbo-260628, seed-2-0-mini-260428, seed-2-0-lite-260428, seed-2-0-pro-260328, seed-2-0-code-preview-260328, deepseek-v4-flash-260425, deepseek-v4-pro-260425, glm-5-2-260617 Minimum string length:
1Example:
"seed-2-0-lite-260428"
Response
A JSON chat completion when stream is false, or an SSE stream when
stream is true.