Skip to main content

Create App

Endpoint: Create App

This endpoint allows you to create a new app on the RunGen.AI platform.

URL

POST https://api.rungen.ai/app

Headers

HeaderTypeRequiredDescription
x-api-keyStringYesYour API key for authentication.
Content-TypeStringYesThe content type of the request (application/json).
x-team-idStringNoThe unique identifier for the team creating the app.

Request Body

FieldTypeRequiredDescription
nameStringYesThe name of the app.
descriptionStringNoA description of the app.
configurationObjectYesConfiguration details for the app.
configuration.gpu_tierStringYesGPU identifiers for the app (BASIC, STANDARD, PERFORMANCE).
configuration.active_workersIntegerNoNumber of active workers.
configuration.locationStringNoLocation of the app.
workflowObjectYesWorkflow settings for the app.
workflow.model_urlStringYesURL of the model used in the workflow.
workflow.toolsObjectNoAdditional tools for the workflow.
workflow.tools.lorasArrayNoA list of LoRAs (Low-Rank Adaptation) to fine-tune the model.

LoRA Configuration (Optional)

If you want to use LoRAs with your app, include them in the workflow.tools.loras field. Each LoRA should have the following properties:

FieldTypeRequiredDescription
idStringYesUnique identifier for the LoRA.
versionIdStringYesVersion ID of the LoRA.
downloadUrlStringYesURL to download the LoRA.
nameStringYesHuman-readable name of the LoRA.
weightFloatYesThe weight or influence of the LoRA on the model.

Example Request with LoRAs

curl --location 'https://api.rungen.ai/app' \
--header 'x-api-key: 12345678890abc' \
--header 'Content-Type: application/json' \
--data '{
"name": "My first app",
"description": "This is my first app",
"configuration": {
"gpu_tier": "STANDARD"
},
"workflow": {
"model_url": "https://huggingface.co/black-forest-labs/FLUX.1-dev",
"tools": {
"loras": [
{
"id": "212532",
"versionId": "244808",
"downloadUrl": "https://civitai.com/api/download/models/244808",
"name": "All Disney Princess XL LoRA Model",
"weight": 0.8
},
{
"id": "200255",
"versionId": "997426",
"downloadUrl": "https://civitai.com/api/download/models/997426",
"name": "Hands XL LoRA",
"weight": 0.7
}
]
}
}
}'

Response

Success

Status Code: 201 Created

Response Body:

{
"id": "unique-app-id",
"name": "My first app",
"description": "This is my first app",
"configuration": {
"gpu_tier": "STANDARD",
"active_workers": null,
"location": null
},
"workflow": {
"model_url": "https://huggingface.co/black-forest-labs/FLUX.1-schnell",
"tools": {
"loras": [
{
"id": "212532",
"name": "All Disney Princess XL LoRA Model",
"weight": 0.8
},
{
"id": "200255",
"name": "Hands XL LoRA",
"weight": 0.7
}
]
}
},
"team_id": "team-id",
"user_id": "user-id"
}

Error

Status Code: 400 Bad Request

Example Response Body:

{
"error": "Invalid request body. Missing required field: 'name'."
}

Status Code: 403 Forbidden

Example Response Body:

{
"error": "Unauthorized access. Invalid API key."
}